Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. server {
  2. listen 80;
  3.  
  4. server_name tylerit.net;
  5.  
  6. root /srv/tylerit_net/wordpress;
  7. index index.php index.html index.htm;
  8.  
  9. location ~ ^/(wp-admin|wp-login.php) {
  10. allow 104.131.2.229;
  11. deny all;
  12. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  13. fastcgi_pass unix:/var/run/php5-fpm.sock;
  14. fastcgi_index index.php;
  15. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  16. include fastcgi_params;
  17. }
  18.  
  19. location / {
  20. try_files $uri $uri/ /index.php?error=404;
  21. }
  22.  
  23. rewrite /wp-admin$ $scheme://$host$uri/ permanent;
  24.  
  25. location ~ \.php$ {
  26. try_files $uri /index.php?error=404;
  27. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  28. fastcgi_pass unix:/var/run/php5-fpm.sock;
  29. fastcgi_index index.php;
  30. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  31. include fastcgi_params;
  32. }
  33.  
  34. location = /favicon.ico {
  35. log_not_found off;
  36. access_log off;
  37. }
  38.  
  39. location = /robots.txt {
  40. allow all;
  41. log_not_found off;
  42. access_log off;
  43. }
  44.  
  45. location ~ /\. {
  46. deny all;
  47. }
  48.  
  49. location ~* /(?:uploads|files)/.*\.php$ {
  50. deny all;
  51. }
  52.  
  53. }
  54.  
  55. server {
  56.  
  57. listen 443 ssl;
  58.  
  59. ssl on;
  60. ssl_certificate_key /etc/ssl/cert/tylerit_net.pem;
  61. ssl_certificate /etc/ssl/cert/ca-bundle.pem;
  62.  
  63. ssl_ciphers 'AES256+EECDH:AES256+EDH:!aNULL';
  64.  
  65. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  66. ssl_session_cache shared:SSL:10m;
  67.  
  68. ssl_stapling on;
  69. ssl_stapling_verify on;
  70. resolver 8.8.4.4 8.8.8.8 valid=300s;
  71. resolver_timeout 10s;
  72.  
  73. ssl_prefer_server_ciphers on;
  74. ssl_dhparam /etc/ssl/certs/dhparam.pem;
  75.  
  76. add_header Strict-Transport-Security max-age=63072000;
  77. add_header X-Frame-Options DENY;
  78. add_header X-Content-Type-Options nosniff;
  79.  
  80. server_name tylerit.net;
  81.  
  82. root /srv/tylerit_net/wordpress;
  83. index index.php index.html index.htm;
  84.  
  85. location ~ ^/(wp-admin|wp-login.php) {
  86. allow 104.131.2.229;
  87. deny all;
  88. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  89. fastcgi_pass unix:/var/run/php5-fpm.sock;
  90. fastcgi_index index.php;
  91. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  92. include fastcgi_params;
  93. }
  94.  
  95. location / {
  96. try_files $uri $uri/ /index.php?error=404;
  97. }
  98.  
  99. rewrite /wp-admin$ $scheme://$host$uri/ permanent;
  100.  
  101. location ~ \.php$ {
  102. try_files $uri /index.php?error=404;
  103. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  104. fastcgi_pass unix:/var/run/php5-fpm.sock;
  105. fastcgi_index index.php;
  106. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  107. include fastcgi_params;
  108. }
  109.  
  110. location = /favicon.ico {
  111. log_not_found off;
  112. access_log off;
  113. }
  114.  
  115. location = /robots.txt {
  116. allow all;
  117. log_not_found off;
  118. access_log off;
  119. }
  120.  
  121. location ~ /\. {
  122. deny all;
  123. }
  124.  
  125. location ~* /(?:uploads|files)/.*\.php$ {
  126. deny all;
  127. }
  128.  
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement