SHARE
TWEET

Fixed Nginx config file

avivroth Jun 28th, 2014 228 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # WPSINGLE BASIC NGINX CONFIGURATION
  2. server {
  3.         listen 80;
  4.        
  5.         server_name avivroth.com www.avivroth.com;
  6.  
  7.         access_log   /var/log/nginx/avivroth.com.access.log rt_cache;
  8.         error_log    /var/log/nginx/avivroth.com.error.log;
  9.  
  10.         root /var/www/avivroth.com/htdocs;
  11.         index index.php index.htm index.html;
  12.  
  13.         location ~ \.php$ {
  14.  
  15.                 location ~ /wp-(admin|login) {
  16.                     return 301 https://$host$request_uri;
  17.                 }
  18.  
  19.                 try_files $uri =404;
  20.                 include fastcgi_params;
  21.                 fastcgi_pass php;
  22.         }
  23.  
  24.         location / {
  25.                 try_files $uri $uri/ /index.php$is_args$args;
  26.         }
  27.  
  28.  
  29.         include common/wpcommon-fixed.conf;
  30.         include common/locations.conf;
  31.  
  32. }
  33.  
  34. server {
  35.         listen 443;
  36.        
  37.         server_name avivroth.com www.avivroth.com;
  38.  
  39.         access_log   /var/log/nginx/avivroth.com.access.log rt_cache;
  40.         error_log    /var/log/nginx/avivroth.com.error.log;
  41.  
  42.         root /var/www/avivroth.com/htdocs;
  43.         index index.php index.htm index.html;
  44.  
  45.         ssl on;
  46.         ssl_certificate /etc/ssl/certs/avivroth.com.crt;
  47.         ssl_certificate_key /etc/ssl/private/avivroth.com.key;
  48.  
  49.         #this no longer includes wp-login because that's being taken care of by common/wpcommon.conf
  50.         location ~/wp-admin {
  51.             location ~ \.php$ {
  52.                 try_files $uri =404;
  53.                 include fastcgi_params;
  54.                 fastcgi_pass php;
  55.             }
  56.         }
  57.  
  58.         location / {
  59.             return 301 http://$host$request_uri;
  60.         }
  61.  
  62.         include common/wpcommon.conf;
  63.         include common/locations.conf;
  64.  
  65. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top