Skip to content

Instantly share code, notes, and snippets.

@KarlBaumann
Created September 14, 2016 14:15
Show Gist options
  • Save KarlBaumann/49f5f9079a92a45f644c5a1dbb6f1a1f to your computer and use it in GitHub Desktop.
Save KarlBaumann/49f5f9079a92a45f644c5a1dbb6f1a1f to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name kalpones.lv www.kalpones.lv;
root /srv/http/kalpones.lv;
....
<------>client_max_body_size 10M;
........
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
<------> try_files $uri $uri/ /index.php?q=$uri&$args;
index index.php index.html index.htm;
}
#<----->log_format postdata $request_body;
<------>location = /wp-login.php {
#<-----> log_format postdata $request_body;
#<-----> access_log /var/log/nginx/postdata.log postdata;
#<-----> fastcgi_pass php_cgi;
<------>}
location ~* \.(js|png|jpg|jpeg|gif|ico|wmv|3gp|avi|mpg|mpeg|mp4|flv|mp3|mid|wml|swf|pdf|doc|docx|ppt|pptx|zip)$ {
expires max;
log_not_found off;
<------><------>access_log off; ##
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
##fastcgi_pass unix:/var/run/php5-fpm.sock;
<------><------>fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment