server {
listen 80
;
server_name
xxx.xxx.xxx.xxx;
root /usr/local/www
;
#index index.html;
#root /usr/local/update/views;
#index login.html;
#error_page 404 = /usr/local/update/views/404.html;
location / {
#try_files /_not_exists_ @backend;
root /home/adas/test
;
index index.html
;
}
# location /(css|js|img|fonts)/ {
# access_log off;
# expires 1d;
# root "/usr/local/update/static/";
# try_files $uri @backend;
#}
##### Forum #####
location /forum {
root /usr/local/forum
;
index index.php index.html index.htm
;
try_files $uri $uri/ /index.php?$query_string
;
}
location /forum/api {
root /usr/local/forum
;
index api.php
;
try_files $uri $uri/ /api.php?$query_string
;
}
location /forum/admin {
root /usr/local/forum
;
index admin.php
;
try_files $uri $uri/ /admin.php?$query_string
;
}
location /forum/assets {
alias /usr/local/forum/assets
;
}
location /forum/flarum {
deny all
;
return 404
;
}
location ~* \.php$ {
root /usr/local/forum
;
fastcgi_split_path_info ^(.+.php)(/.+)$
;
fastcgi_pass unix:/var/run/php/php5.6-fpm.sock
;
include fastcgi_params
;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name
;
fastcgi_param HTTP_PROXY
""
; # Fix for https://httpoxy.org/ vulnerability
fastcgi_index index.php
;
}
location /static {
proxy_set_header X-Forwarded-For $remote_addr
;
proxy_set_header Host $http_host
;
proxy_pass http://127.0.0.1:8778
;
}
location @backend {
proxy_set_header X-Forwarded-For $remote_addr
;
proxy_set_header Host $http_host
;
proxy_pass http://127.0.0.1:8777
;
}
}