Advertisement
jxsl13

Untitled

Oct 9th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. server {
  2. listen 51.254.88.34:80;
  3. server_name uptee.net;
  4. if ($host != $server_name) {
  5. return 444;
  6.  
  7. # address and port accepted by the server
  8. #listen 80; ## listen for ipv4
  9. #listen [::]:80 default ipv6only=on; ## listen for ipv6
  10.  
  11. # server IP to compare against http requests, uncomment and set proper value.
  12. # Enter the hostname or IP address you use to reach this server. If you run on your dev environment it might be localhost.
  13. # Note: If your vb install is in a folder inside your domain <mysite>/forum/install/path please change location directives defined below to include the path first. e.G:
  14. # vbulletin.com/forum
  15. #
  16. # css directive would be:
  17. # location = /forum/css\.php {
  18. # rewrite ^ /forum/core/css.php break;
  19. #}
  20.  
  21.  
  22. }
  23. server_name_in_redirect off;
  24.  
  25. gzip on;
  26. gzip_http_version 1.1;
  27. gzip_comp_level 6;
  28. gzip_min_length 1100;
  29. gzip_buffers 4 8k;
  30. gzip_types text/plain application/xhtml+xml text/css application/xml application/xml+rss text/javascript application/javascrip$
  31. gzip_proxied any;
  32. gzip_disable "MSIE [1-6]\.";
  33.  
  34. #access_log /var/log/nginx/localhost.access_log main;
  35. #error_log /var/log/nginx/localhost.error_log info;
  36.  
  37. root /home/uptee/website/;
  38. index index.php index.html index.htm default.html default.htm;
  39.  
  40. # Support Clean (aka Search Engine Friendly) URLs
  41. location / {
  42. try_files $uri $uri/ /index.php?$args;
  43. }
  44.  
  45. # deny running scripts inside writable directories
  46. location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
  47. return 403;
  48. error_page 403 /403_error.html;
  49. }
  50.  
  51. location ~ \.php$ {
  52.  
  53. root /home/uptee/website/;
  54.  
  55. # handles legacy scripts
  56. if (!-f $request_filename) {
  57. rewrite ^/(.*)$ /index.php?routestring=$1 break;
  58. }
  59.  
  60. fastcgi_split_path_info ^(.+\.php)(.*)$;
  61. fastcgi_pass unix:/run/php-fpm/php-fpm-uptee.sock;
  62. fastcgi_index index.php;
  63. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  64. include fastcgi_params;
  65. fastcgi_param QUERY_STRING $query_string;
  66. fastcgi_param REQUEST_METHOD $request_method;
  67. fastcgi_param CONTENT_TYPE $content_type;
  68. fastcgi_param CONTENT_LENGTH $content_length;
  69. fastcgi_intercept_errors on;
  70. fastcgi_ignore_client_abort off;
  71. fastcgi_connect_timeout 60;
  72. fastcgi_send_timeout 180;
  73. fastcgi_read_timeout 180;
  74. fastcgi_buffers 256 16k;
  75. fastcgi_buffer_size 32k;
  76. fastcgi_temp_file_write_size 256k;
  77. }
  78. }
  79.  
  80. # caching of files
  81. location ~* \.(ico|pdf|flv)$ {
  82. expires 1y;
  83. }
  84.  
  85. location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ {
  86. expires 14d;
  87. }
  88.  
  89. }
  90. upstream php5 {
  91. # address to accept FastCGI requests. Make sure you set the right value under your fast cgi conf.
  92. # e.g.- Ubuntu 12.10 using php5-fpm Ubuntu /etc/php5/fpm/pool.d/www.conf
  93. server unix:/run/php-fpm/php-fpm-uptee.sock;
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement