Advertisement
Guest User

nginx wp-conf

a guest
May 17th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.01 KB | None | 0 0
  1. # Upstream to abstract backend connection(s) for php
  2. upstream php {
  3.         server 127.0.0.1:9000;
  4. }
  5.  
  6. server {
  7.         ## Your website name goes here.
  8.         server_name <YOUR THEME>
  9.         ## Your only path reference.
  10.         root /var/www/html/wordpress;
  11.         ## This should be in your http block and if it is, it's not needed here.
  12.         index index.php;
  13.  
  14.  
  15.         location / {
  16.                 # This is cool because no php is touched for static content.
  17.                 # include the "?$args" part so non-default permalinks doesn't break when using query string
  18.                 try_files $uri $uri/ /index.php?$args;
  19.         }
  20.  
  21.         location ~ \.php$ {
  22.                 #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  23.                 include fastcgi.conf;
  24.                 fastcgi_intercept_errors on;
  25.                 fastcgi_pass php;
  26.         }
  27.  
  28.         location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  29.                 expires max;
  30.                 log_not_found off;
  31.         }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement