Guest User

Untitled

a guest
Nov 21st, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.16 KB | None | 0 0
  1. fastcgi_cache_path /etc/nginx/cache levels=1:2 keys_zone=MYAPP:512m inactive=180m;
  2. fastcgi_cache_key "$scheme$request_method$remote_addr$request_uri";
  3. server {
  4. server_name openspeedtest.com www.openspeedtest.com 23.239.29.5;
  5. listen 23.239.29.5 default_server;
  6. listen [2600:3c00::f03c:91ff:fe08:149b] default_server;
  7. root /home/openspeedtest/public_html;
  8. index index.html index.htm index.php;
  9. access_log /var/log/virtualmin/openspeedtest.com_access_log;
  10. error_log /var/log/virtualmin/openspeedtest.com_error_log;
  11. fastcgi_param GATEWAY_INTERFACE CGI/1.1;
  12. fastcgi_param SERVER_SOFTWARE nginx;
  13. fastcgi_param QUERY_STRING $query_string;
  14. fastcgi_param REQUEST_METHOD $request_method;
  15. fastcgi_param CONTENT_TYPE $content_type;
  16. fastcgi_param CONTENT_LENGTH $content_length;
  17. fastcgi_param SCRIPT_FILENAME /home/openspeedtest/public_html$fastcgi_script_name;
  18. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  19. fastcgi_param REQUEST_URI $request_uri;
  20. fastcgi_param DOCUMENT_URI $document_uri;
  21. fastcgi_param DOCUMENT_ROOT /home/openspeedtest/public_html;
  22. fastcgi_param SERVER_PROTOCOL $server_protocol;
  23. fastcgi_param REMOTE_ADDR $remote_addr;
  24. fastcgi_param REMOTE_PORT $remote_port;
  25. fastcgi_param SERVER_ADDR $server_addr;
  26. fastcgi_param SERVER_PORT $server_port;
  27. fastcgi_param SERVER_NAME $server_name;
  28. fastcgi_param HTTPS $https;
  29. location ~ \.php$ {
  30. fastcgi_cache MYAPP;
  31. fastcgi_cache_valid 200 180m;
  32. try_files $uri =404;
  33. fastcgi_pass unix:/var/php-nginx/145599868231392.sock/socket;
  34.  
  35. if ($http_origin ~* (https?://[^/]*\.openspeedtest\.com(:[0-9]+)?|https?://openspeedtest\.com(:[0-9]+)?)) {
  36. add_header 'Access-Control-Allow-Origin' "$http_origin" always;
  37. add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With' always;
  38. add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
  39.  
  40. }
  41.  
  42. if ($request_method = OPTIONS ) {
  43. add_header Access-Control-Allow-Credentials "true";
  44. add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With' always;
  45. add_header 'Access-Control-Allow-Origin' "$http_origin" always;
  46. add_header Access-Control-Allow-Methods "GET, POST, OPTIONS" always;
  47. return 204;
  48. }
  49.  
  50. }
  51. listen 23.239.29.5:443 default_server ssl;
  52. listen [2600:3c00::f03c:91ff:fe08:149b]:443 default_server ssl;
  53. ssl_certificate /home/openspeedtest/ssl.cert;
  54. ssl_certificate_key /home/openspeedtest/ssl.key;
  55. error_page 405 =200 $uri;
  56. error_page 404 /404.php;
  57. if ($http_host = www.openspeedtest.com) {
  58. rewrite (.*) http://openspeedtest.com$1 permanent;
  59. }
  60. fastcgi_read_timeout 360;
  61. client_max_body_size 2000M;
  62.  
  63. listen [::];
  64. access_log off;
  65. error_log /dev/null;
  66. log_not_found off;
  67. server_tokens off;
  68. location ~* \.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ {
  69.  
  70. if ($http_origin ~* (https?://[^/]*\.openspeedtest\.com(:[0-9]+)?|https?://openspeedtest\.com(:[0-9]+)?)) {
  71. add_header 'Access-Control-Allow-Origin' "$http_origin" always;
  72. add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With' always;
  73. add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
  74.  
  75. }
  76.  
  77. if ($request_method = OPTIONS ) {
  78. add_header Access-Control-Allow-Credentials "true";
  79. add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With' always;
  80. add_header 'Access-Control-Allow-Origin' "$http_origin" always;
  81. add_header Access-Control-Allow-Methods "GET, POST, OPTIONS" always;
  82. return 204;
  83. }
  84. expires 365d;
  85.  
  86. }
  87. location / {
  88. if ($http_origin ~* (https?://[^/]*\.openspeedtest\.com(:[0-9]+)?|https?://openspeedtest\.com(:[0-9]+)?)) {
  89. add_header 'Access-Control-Allow-Origin' "$http_origin" always;
  90. add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With' always;
  91. add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
  92.  
  93. }
  94.  
  95. if ($request_method = OPTIONS ) {
  96. add_header Access-Control-Allow-Credentials "true";
  97. add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With' always;
  98. add_header 'Access-Control-Allow-Origin' "$http_origin" always;
  99. add_header Access-Control-Allow-Methods "GET, POST, OPTIONS" always;
  100. return 204;
  101. }
  102. }
  103.  
  104. location /results {
  105. rewrite ^/results/(.*)$ /results/index.php?r=$1 last;
  106. }
  107.  
  108.  
  109. }
Add Comment
Please, Sign In to add comment