Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name mydomain.com *.mydomain.com;
- rewrite ^/(.*) http://www.mydomain.com/$1 permanent;
- # rewrite ^/([^?]*)(?:\?(.*))? index.php?thumb=$1$2;
- }
- server {
- listen 80;
- # access_log /var/www/mydomain/log/access.log;
- error_log /var/www/mydomain/log/error.log notice;
- server_name www.mydomain.com;
- root /var/www/mydomain/;
- location / {
- index index.php;
- try_files $uri $uri/ /index.php?q=$uri&$args;
- # if the requested file exists, return it immediately
- if (-f $request_filename) {
- break;
- }
- # all other requests go to WordPress
- if (!-e $request_filename) {
- rewrite . /index.php last;
- }
- }
- ## Images and static content is treated different
- location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
- access_log off;
- expires 30d;
- root /var/www/mydomain/;
- }
- ## Parse all .php file in the /var/www directory
- location ~ .php$ {
- fastcgi_split_path_info ^(.+\.php)(.*)$;
- fastcgi_pass backend;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME /var/www/mydomain/$fastcgi_script_name;
- include fastcgi_params;
- fastcgi_param QUERY_STRING $query_string;
- fastcgi_param REQUEST_METHOD $request_method;
- fastcgi_param CONTENT_TYPE $content_type;
- fastcgi_param CONTENT_LENGTH $content_length;
- fastcgi_intercept_errors on;
- fastcgi_ignore_client_abort on;
- fastcgi_read_timeout 180;
- }
- ## Disable viewing .htaccess & .htpassword
- location ~ /\.ht {
- deny all;
- }
- }
- upstream backend {
- server 127.0.0.1:9000;
- }
Add Comment
Please, Sign In to add comment