Tag Info

Hot answers tagged

3

This happens because, in most web servers, the default action for folders is "Directory listing" which is disabled by default. The same would happen in Apache usually if you disable Directory indexing. What you can do in nginx is to put =404 at the end of your try_files directive. You can do this by putting /index.php at the end of the try_files directive. ...


3

They are two bugs opened recently related to this issue: #67244 Wrong owner:group for listening unix socket #67175 Change to the default listen.mode setting I personally experience the first one on FreeBSD with php version 5.4.30 For workaround I applied both parameters available to specify the owner of the socket like this: [default] listen = ...


1

The auth_http does two main things: It authenticates users (including various options to effectively delay users on failed authentication). And it determines which backend to use (and which username and password to use in backend authentication, if at all). While in some cases authentication can be handled directly by a backend, it's not something always ...


1

I do not know if it is right to answer my own question. But after some days I finally found the solution. I want to thank Alexey Ten for mentioning the word "module". It seems the pagespeed module is the problem. Disabling pagespeed in the nginx configuration files solved the problem. I've read pagespeed only changes html so probably pagespeed thought this ...


1

I believe it's caused by this line: root /home/www-data/public-www; http://nginx.org/en/docs/http/ngx_http_core_module.html#root you can remove that, or specify somewhere else.


1

Uncompressed files are not required on Nginx 1.6 with: location ~ \.txt$ { gzip_static on; gunzip on; } Both curl http://localhost/index.txt and curl -H "Accept-Encoding: gzip" http://localhost/index.txt | gunzip now work fine with just /srv/www/localhost/index.txt.gz in my root directory.


1

Typically you would put the SSL configuration in the frontend web server, and then simply forward without SSL to the backend server. If you have multiple backend servers, you will likely need vhosts. The nginx wiki mentions this page which even goes through a full explanation of possibly exactly what you are doing.


1

Since you have nginx behind an SSL-terminating load balancer, I don't think it will be easy for you to avoid using if. But not all is lost. To be "not evil" you can replace rewrite permanent with return, one of the safe things you can do with if. return 301 https://$http_host$request_uri; This will simply reconstruct the URL with https, and ...


1

You have two entirely separate connections. The connection from the web browser to nginx is encrypted with SSL, and so nginx has to be configured for SSL. The connection from nginx to Apache to retrieve the data for nginx to send to the browser should be a regular http connection with no SSL, so Apache doesn't need to have any SSL configuration.


1

I am confused as to why you use server_name _. This used to be used for the designate a default sever but then you set server_name www.mydomain.com stanza as the default (listen 80 default_server). I would rewrite your configuration this way: server { listen 80; listen [::]:80; server_name www.mydomain.com; root ...


1

Solved it. It turns out that the problem was the permissions set on the socket where php was listening. I just had to change a directive called listen.mode on /etc/php-fpm.d/www.conf listen.mode = 0750 And set the user to nginx: listen.owner = nginx listen.group = nginx So the file looks like this: srwxr-x---. 1 nginx nginx 0 jul 8 08:59 ...


1

As soon as I typed the word "include" in my question above, the wheels started spinning in my head. Turns out you can absolutely just put allow and deny directives into an include file and they will work just as expected. Best of all, this means I can combine lists of IPs so certain groups of servers can access some directories while others can't. I have ...


1

Since you did not define custom error page for 301 error, nginx sends it's built-in special page with predefined headers. See https://github.com/nginx/nginx/blob/master/src/http/ngx_http_special_response.c#L646


1

Either you are using an ancient version of nginx (< 0.7.21) or ngx_http_limit_req_module module is not compiled into your nginx build (which is a bit odd). Run nginx -V 2>&1 | grep --colour=auto limit to check if maybe it's been disabled at build.


1

There are several problems in your configuration. First, you are using root directive inside locations. This is most likely the reason for 404 errors. You should change the first location block to start like this: location /postfixadmin { alias /var/www/html/postfixadmin/; Then, you should remove the root directive from the first inner location ...



Only top voted, non community-wiki answers of a minimum length are eligible