Fixing Nginx proxy.

pull/63/head
Ivan Grynenko 8 years ago
parent 6891f4701c
commit 5bfd4ea15c
  1. 16
      group_vars/all.yml

@ -171,15 +171,20 @@ nginx_vhosts:
access_log off; access_log off;
} }
location / { location / {
index index.php; proxy_pass http://127.0.0.1:{{ apache_listen_port }};
try_files $uri $uri/ /index.php; proxy_set_header Host $host;
expires max; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
add_header X-Cache $upstream_cache_status;
add_header X-Loaded "/";
} }
location ~ \.php$ { location ~ \.php$ {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_pass http://127.0.0.1:{{ apache_listen_port }}; proxy_pass http://127.0.0.1:{{ apache_listen_port }};
add_header X-Cache $upstream_cache_status;
add_header X-Loaded "php";
} }
location = /backup { location = /backup {
deny all; deny all;
@ -216,3 +221,8 @@ nginx_vhosts:
location ~ /\.ht { location ~ /\.ht {
deny all; deny all;
} }
location @rewrite {
# Some modules enforce no slash (/) at the end of the URL
# Else this rewrite block wouldn't be needed (GlobalRedirect)
rewrite ^/(.*)$ /index.php?q=$1 last;
}