Advertisement
Guest User

/etc/nginx/wordpress.conf

a guest
Jul 19th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.30 KB | None | 0 0
  1. # WordPress single site rules.
  2. # Designed to be included in any server {} block.
  3.  
  4. # This order might seem weird - this is attempted to match last if rules below fail.
  5. # http://wiki.nginx.org/HttpCoreModule
  6. location / {
  7.     try_files $uri $uri/ /index.php?$args;
  8. }
  9.  
  10. # Add trailing slash to */wp-admin requests.
  11. rewrite /wp-admin$ $scheme://$host$uri/ permanent;
  12.  
  13. # Directives to send expires headers and turn off 404 error logging.
  14. location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
  15.        access_log off; log_not_found off; expires max;
  16. }
  17.  
  18. # Uncomment one of the lines below for the appropriate caching plugin (if used).
  19. #include global/wordpress-wp-super-cache.conf;
  20. #include global/wordpress-w3-total-cache.conf;
  21.  
  22. # Pass all .php files onto a php-fpm/php-fcgi server.
  23. location ~ [^/]\.php(/|$) {
  24.     fastcgi_split_path_info ^(.+?\.php)(/.*)$;
  25.     if (!-f $document_root$fastcgi_script_name) {
  26.         return 404;
  27.     }
  28.     # This is a robust solution for path info security issue and works with "cgi.fix_pathinfo = 1" in /etc/php.ini (default)
  29.  
  30.     include fastcgi_params;
  31.     fastcgi_index index.php;
  32.     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  33. #   fastcgi_intercept_errors on;
  34.     fastcgi_pass php;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement