location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_pass http://127.0.0.1:8080;
}
location ~ \.php$ {
if (!-e $document_root$document_uri) {
return 404;
}
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^.+\.(txt|jpg|jpeg|gif|mpg|mpeg|avi|png|css|swf|ico|zip|rar|sdt|js|bmp|wav|mp3|mmf|mid|vkp|sisx|sis|exe|jar|thm|nth|doc)$ {
access_log off;
expires 1w;
add_header Cache-Control 'public';
try_files $uri @notfound;
}
location @notfound {
proxy_pass http://127.0.0.1:8080$request_uri;
}
server {
location / {
try_files $uri $uri/ /index.php?q=$uri&args;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/ipboard.sock;
fastcgi_index index.php;
fastcgi_buffers 16 8k;
fastcgi_buffer_size 16k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}