Guest User

Untitled

a guest
Dec 27th, 2015
114
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2. listen 80;
  3. server_name www.domain.com;
  4. return 301 $scheme://elsitar.com$request_uri;
  5. if ($scheme = http) {
  6. return 301 https://$server_name$request_uri;
  7. }
  8.  
  9. }
  10.  
  11.  
  12.  
  13. server {
  14.  
  15. listen 443 default_server ssl;
  16.  
  17. server_name domain.com;
  18. access_log off;
  19. ssl_certificate /etc/ssl/private/cert_chain.crt;
  20. ssl_certificate_key /etc/ssl/private/server.key;
  21.  
  22. if ($allow = no) {
  23. return 403;
  24. }
  25. if ($bad_referer) {
  26. return 444;
  27. }
  28.  
  29. location / {
  30. proxy_pass http://127.0.0.1:8080;
  31. proxy_set_header X-Real-IP $remote_addr;
  32. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  33. proxy_set_header X-Forwarded-Proto https;
  34. proxy_set_header X-Forwarded-Port 443;
  35. proxy_set_header Host $host;
  36. proxy_redirect off;
  37. proxy_set_header HTTPS "on";
  38. }
  39. }
  40.  
  41. server {
  42.  
  43. listen 127.0.0.1:8081;
  44. root /var/www/elsitar.com/wordpress;
  45. index index.php index.html index.htm;
  46. server_name elsitar.com;
  47. error_log /var/log/nginx/upstream.log info;
  48.  
  49. if ($allow = no) {
  50. return 403;
  51. }
  52. if ($bad_referer) {
  53. return 444;
  54. }
  55.  
  56.  
  57.  
  58. 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|css|js)$ {
  59. add_header Cache-Control "public, max-age=600";
  60. add_header Access-Control-Allow-Headers "X-Requested-With";
  61. add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS";
  62. add_header Access-Control-Allow-Origin "*";
  63.  
  64. access_log off;
  65. }
  66.  
  67. client_body_buffer_size 124K;
  68.  
  69. client_header_buffer_size 1k;
  70.  
  71. client_max_body_size 100m;
  72.  
  73. large_client_header_buffers 4 16k;
  74.  
  75. error_page 404 /404.html;
  76.  
  77.  
  78.  
  79. gzip on;
  80. gzip_disable "msie6";
  81. gzip_vary on;
  82. gzip_proxied any;
  83. gzip_comp_level 6;
  84. gzip_buffers 16 8k;
  85. gzip_http_version 1.1;
  86. gzip_types application/json application/x-javascript application/xml text/javascript text/plain text/css application/javascript text/xml application/xml+rss;
  87. try_files $uri $uri/ /index.php?$args;
  88. # Rewrites for Yoast SEO XML Sitemap
  89. rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
  90. rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
  91. include hhvm.conf;
  92. include domain.com-ps.conf;
  93. rewrite /wp-admin$ $scheme://$server_name$uri/ permanent;
  94. error_page 500 502 503 504 /50x.html;
  95. location = /50x.html {
  96. root /usr/share/nginx/html;
  97. }
  98.  
  99. if ($bad_client) { return 403; }
  100.  
  101.  
  102.  
  103. location / {
  104. try_files $uri $uri/ /index.php?$args;
  105. }
  106.  
  107.  
  108. }
RAW Paste Data