Posts

Showing posts with the label nginx

Nginx [emerg] “server” directive is not allowed here

Nginx [emerg] “server” directive is not allowed here I'm coming with problem with NGinx - probably it's my fault somewhere but I can't find solution. I made custom vhost block in DEFAULT nginx config. And I don't know if it's problem of that and I should do custom vhost in other file in "sites-available" or it's possible in this nginx config. I'm struggling with that error: [root@openvpn etc]# nginx -t nginx: [emerg] "server" directive is not allowed here in /etc/nginx/nginx.conf:69 nginx: configuration file /etc/nginx/nginx.conf test failed Here it's my nginx.conf nginx.conf # For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf...

Nginx PHP Failing with Large File Uploads (Over 6 GB)

Image
Nginx PHP Failing with Large File Uploads (Over 6 GB) I am having a very weird issue uploading larges files over 6GB. My process works like this: My PHP(HHVM) and NGINX configuration both have their configuration set to allow up to 16GB of file, my test file is only 8GB. Here is the weird part, the ajax will ALWAYS time out. But the file is successfully uploaded, its gets copied to the tmp location, the location stored in the db, s3, etc. But the AJAX runs for an hour even AFTER all the execution is finished(which takes 10-15 minutes) and only ends when timing out. What can be causing the server not send a response for only large files? Also error logs on server side are empty. You need to post the code if you want some help figuring out what might be wrong with it. – Barmar Jun 5 '17 at 15:04 Do you make r...

Font files are blocked by CORS policy

Image
Font files are blocked by CORS policy I want to build a server accelerated by a CDN provider, which serves static files for my other websites. I decide to use https://www.funfun.org.cn, then for example https://www.funfun.org.cn/libs/font-awesome.min.css and https://www.funfun.org.cn/libs/octicons.min.css should be able to be used by other websites. However, when I test this server by my website in localhost, I see the following errors: For example, Access to Font at 'https://www.funfun.org.cn/libs/octicons.woff' from origin 'https://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://localhost:3000' is therefore not allowed access. Other errors are similar and for https://www.funfun.org.cn/fonts/fontawesome-webfont.woff2?v=4.4.0 and https://www.funfun.org.cn/libs/octicons.ttf , etc. https://www.funfun.org.cn/fonts/fontawesome-webfont.woff2?v=4.4.0 https:/...

How to host Laravel application in a sufolder along with normal php application?

How to host Laravel application in a sufolder along with normal php application? I have a laravel application and a normal application. I want the normal application to run when user opens example.com/ but when the user opens example.com/laravel_application/ I want the laravel application to run. How can I achieve this. I tried various methods like creating symlinks but I seem to be always redirected to root directory ( example.com/ ) e.g. when I open example.com/laravel_application/login I am open to using apache or nginx. example.com/ example.com/laravel_application/ example.com/ example.com/laravel_application/login 3 Answers 3 It's easier to add a subdomain for Laravel app. Otherwise, you will have to create Laravel routes based on the example.com/laravel_app path. There are two solutions: Create .htaccess file on sub-folder where you put your laravel application. and add the code in .htac...

Apache two apps one domain share language /en - Magento & Wordpress

Apache two apps one domain share language /en - Magento & Wordpress We have Wordpress in the root / in a physical subfolder /wp and Magento in /products. We are wanting to make the sites multi-language using sub folders e.g domain.com/en The problem arises as magento appends the store code (language) after the url so we have domain.com/en (wordpress) domain.com/products/en (magento) Naturally we would like domain.com/en domain.com/en/products Now it's very easy to make it work with some rewrite rule RewriteRule ^(.*)/products/?(.*)$ /products/$1 [L] But still we have an issue as Magento generates the links as /products/en it's possible to start modifying where these links are generated like in MagentoStoreModelStore In the _updatePathUseStoreView function, this doesn't seem to handle all links though In general seems like a bad solution, another idea is to use Apache mod_substitute also seems bad practice, and overhead. Another option is to have both apps in the root an...

Showing HTML code sometimes in NGINX PHP [closed]

Showing HTML code sometimes in NGINX PHP [closed] I am using nginx 1.12.1 and PHP 7.1 , sometime it is showing html code like below nginx 1.12.1 PHP 7.1 0 HTTP/1.1 200 OK Transfer encoding : chunked Connection: keep-alive ac7c . . . 0 Please let me know how we can fix this issue. Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

Docker socket crash after stack up

Image
Docker socket crash after stack up I trying to deploy docker stack, that includes my development environment. But in random cases I have next error: failed to create service < service_name >: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? Next I restart docker daemon. Sometimes it requires to kill docker processes and shims. I deleting old stack and build again. Some times docker successfully finishes build, but socket crashes on the starting stage. Also all containers work properly when I starting it in regular mode, without swarm or stack. It is not work exactly inside swarm. I have used next command to build: $ docker stack deploy dev-env-stc -c docker-compose.yml Environment run in Antergos Linux(Arch). Layout is like at the diagram Nginx container and docker networks created using commands: $ docker run --detach --name nginx-main --net dev-env-ext --ip 10.20.20.10 --publish 80:80 --publish 443:443 --volume /env-vol/nginx...