Guest User

Untitled

a guest
Nov 21st, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 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.  
  33. try_files $uri =404;
  34. fastcgi_pass unix:/var/php-nginx/145599868231392.sock/socket;
  35. }
  36. listen 23.239.29.5:443 default_server ssl;
  37. listen [2600:3c00::f03c:91ff:fe08:149b]:443 default_server ssl;
  38.  
  39. ssl_certificate /home/openspeedtest/ssl.cert;
  40. ssl_certificate_key /home/openspeedtest/ssl.key;
  41. error_page 405 =200 $uri;
  42. error_page 404 /404.php;
  43. if ($http_host = www.openspeedtest.com) {
  44. rewrite (.*) http://openspeedtest.com$1 permanent;
  45. }
  46. fastcgi_read_timeout 360;
  47. client_max_body_size 2000M;
  48.  
  49. listen [::];
  50. access_log off;
  51. error_log /dev/null;
  52. log_not_found off;
  53. server_tokens off;
  54. 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)$ {
  55. expires 365d;
  56. }
  57.  
  58. location / {
  59.  
  60. if ($http_origin) {
  61. add_header 'Access-Control-Allow-Origin' 'http://openspeedtest.com';
  62. add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  63.  
  64. }
  65. if ($request_method = OPTIONS ) {
  66. add_header Access-Control-Allow-Credentials "true";
  67. 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';
  68. add_header Access-Control-Allow-Origin "http://openspeedtest.com";
  69. add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
  70. return 204;
  71. }
  72. }
  73.  
  74.  
  75. location /results {
  76.  
  77. # index index.php index.html;
  78. # send url to index.php and append the requested uri to the end unless the file/directory exists
  79. #if (!-e $request_filename){
  80. #rewrite ^/finalversion/results/(.*)$ finalversion/results/?r=/$1? last;
  81. #rewrite ^/finalversion/results/([a-zA-Z0-9/-]+).html/?$ /index.php?r=$1 last;
  82.  
  83. rewrite ^/results/(.*)$ /results/index.php?r=$1 last;
  84.  
  85. #}
  86.  
  87. }
  88. }
Add Comment
Please, Sign In to add comment