server {
listen 80;
server_name example.com www.example.com;
access_log off;
#access_log /srv/www/example.com/logs/example.com-acc main;
error_log /srv/www/example.com/logs/example.com-err;
client_max_body_size 256m;
location / {
try_files $uri /index.php$is_args$args; # redirect to index
proxy_pass http://127.0.0.1:8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 300;
proxy_buffer_size 16k;
proxy_buffers 32 16k;
}
location ~* \.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|flv|avi|djvu|mp3|mp4|ogv|3gp|otf)$ {
root /srv/www/example.com/htdocs/public;
}
}
location /page404 {
try_files $uri /index.php
}