Advertisement
Guest User

Untitled

a guest
Jan 19th, 2015
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. server {
  2. #listen 80 default_server;
  3. #listen [::]:80 default_server ipv6only=on;
  4.  
  5. listen 443;
  6. ssl on;
  7. ssl_certificate /xx/xxx/xxx/ssl.crt;
  8. ssl_certificate_key /xx/xxx/xxx/ssl.key;
  9.  
  10. root /var/www/html/drupal;
  11. index index.php index.html index.htm;
  12.  
  13. error_page 404 /404.html;
  14. error_page 500 502 503 504 /50x.html;
  15. location = /50x.html {
  16. root /usr/share/nginx/html;
  17. }
  18.  
  19. location = /favicon.ico {
  20. log_not_found off;
  21. access_log off;
  22. }
  23.  
  24. location = /robots.txt {
  25. allow all;
  26. log_not_found off;
  27. access_log off;
  28. }
  29.  
  30. location ~ \..*/.*\.php$ {
  31. return 403;
  32. }
  33.  
  34. location ~ ^/sites/.*/private/ {
  35. return 403;
  36. }
  37.  
  38. location ~ (^|/)\. {
  39. return 403;
  40. }
  41.  
  42. location / {
  43. try_files $uri @rewrite;
  44. }
  45.  
  46. location @rewrite {
  47. rewrite ^ /index.php;
  48. }
  49.  
  50. location ~ \.php$ {
  51. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  52. include fastcgi_params;
  53. fastcgi_param SCRIPT_FILENAME $request_filename;
  54. fastcgi_intercept_errors on;
  55. fastcgi_pass unix:/var/run/php5-fpm.sock;
  56. }
  57.  
  58. location ~ ^/sites/.*/files/styles/ {
  59. try_files $uri @rewrite;
  60. }
  61. ### advagg_css and advagg_js support
  62. location ~* files/advagg_(?:css|js)/ {
  63. access_log off;
  64. expires max;
  65. add_header ETag "";
  66. add_header Cache-Control "max-age=2628000, no-transform, public";
  67. try_files $uri $uri/ @rewrites;
  68. #try_files $uri @drupal;
  69. }
  70. location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  71. expires max;
  72. log_not_found off;
  73. }
  74. }
  75.  
  76. server {
  77. server_name www.SITENAME.com SITENAME.com;
  78. return 301 https://SITENAME.com$request_uri;
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement