Guest User

Untitled

a guest
Dec 10th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. user www-data;
  2. worker_processes auto;
  3. pid /run/nginx.pid;
  4.  
  5. events {
  6. worker_connections 768;
  7. }
  8.  
  9. http {
  10.  
  11. sendfile on;
  12. #tcp_nopush on;
  13. #tcp_nodelay on;
  14. keepalive_timeout 65;
  15. types_hash_max_size 2048;
  16.  
  17.  
  18. include /etc/nginx/mime.types;
  19. default_type application/octet-stream;
  20.  
  21. ##
  22. # Upstream PHP
  23. ##
  24.  
  25. upstream php {
  26. server unix:/tmp/php-fpm.sock;
  27. server 127.0.0.1:9000;
  28. }
  29.  
  30. ##
  31. # SSL Settings
  32. ##
  33.  
  34. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
  35. ssl_prefer_server_ciphers on;
  36.  
  37. ##
  38. # Logging Settings
  39. ##
  40.  
  41. access_log /var/log/nginx/access.log;
  42. error_log /var/log/nginx/error.log debug;
  43.  
  44. include /etc/nginx/conf.d/*.conf;
  45. include /etc/nginx/sites-enabled/*;
  46. }
  47.  
  48. server {
  49. listen 80;
  50. listen [::]:80;
  51.  
  52. index index.php;
  53.  
  54. location = /favicon.ico {
  55. log_not_found off;
  56. access_log off;
  57. }
  58.  
  59. location = /robots.txt {
  60. allow all;
  61. log_not_found off;
  62. access_log off;
  63. }
  64.  
  65. location / {
  66. # This is cool because no php is touched for static content.
  67. # include the "?$args" part so non-default permalinks doesn't break when using query string
  68. try_files $uri $uri/ /index.php?$args;
  69. }
  70.  
  71. location ~ .php$ {
  72. #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  73. include fastcgi.conf;
  74. fastcgi_intercept_errors on;
  75. fastcgi_pass php;
  76. fastcgi_buffers 16 16k;
  77. fastcgi_buffer_size 32k;
  78. }
  79.  
  80. location ~* .(js|css|png|jpg|jpeg|gif|ico)$ {
  81. expires max;
  82. # log_not_found off;
  83. }
  84. }
  85.  
  86. location = /favicon.ico {
  87. log_not_found off;
  88. access_log off;
  89. }
  90. # robots.txt fallback to index.php
  91. location = /robots.txt {
  92. # Some WordPress plugin gererate robots.txt file
  93. allow all;
  94. try_files $uri $uri/ /index.php?$args @robots;
  95. access_log off;
  96. log_not_found off;
  97. }
  98.  
  99. location @robots {
  100. return 200 "User-agent: *nDisallow: /wp-admin/nAllow: /wp-admin/admin-ajax.phpn";
  101. }
  102.  
  103.  
  104. location ~ /.(?!well-known/) {
  105. deny all;
  106. }
  107.  
  108. location /wp-content/uploads {
  109. location ~ .php$ {
  110. deny all;
  111. }
  112. }
  113.  
  114.  
  115. location ~* /(?:uploads|files)/.*.php$ {
  116. deny all;
  117. }
  118.  
  119. server {
  120.  
  121. root /var/www/html;
  122.  
  123. index index.html index.htm index.nginx-debian.html index.php;
  124.  
  125. server_name mydomain.site www.mydomain.site;
  126.  
  127. location / {
  128. try_files $uri $uri/ =404;
  129. }
  130.  
  131. location ~ .php$ {
  132. include snippets/fastcgi-php.conf;
  133. fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  134. }
  135. }
  136.  
  137. server {
  138.  
  139. include global/wordpress.conf;
  140. include global/wp-restrictions.conf;
  141.  
  142. server_name sub.mydomain.site;
  143.  
  144. root /var/www/microsites/lgw/;
  145.  
  146. index index.php;
  147. }
Add Comment
Please, Sign In to add comment