Guest User

Untitled

a guest
Nov 7th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. # You may add here your
  2. # server {
  3. # ...
  4. # }
  5. # statements for each of your virtual hosts to this file
  6.  
  7. ##
  8. # You should look at the following URL's in order to grasp a solid understanding
  9. # of Nginx configuration files in order to fully unleash the power of Nginx.
  10. # http://wiki.nginx.org/Pitfalls
  11. # http://wiki.nginx.org/QuickStart
  12. # http://wiki.nginx.org/Configuration
  13. #
  14. # Generally, you will want to move this file somewhere, and start with a clean
  15. # file but keep this around for reference. Or just disable in sites-enabled.
  16. #
  17. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  18. ##
  19.  
  20. server {
  21. listen 80; ## listen for ipv4; this line is default and implied
  22. #listen [::]:80 default ipv6only=on; ## listen for ipv6
  23.  
  24. root /home/vishal/Dropbox/sites/;
  25. index index.php index.html index.htm;
  26.  
  27. # Make site accessible from http://localhost/
  28. server_name localhost;
  29.  
  30.  
  31. location / {
  32. # First attempt to serve request as file, then
  33. # as directory, then fall back to index.html
  34. try_files $uri $uri/ /index.html;
  35. # Uncomment to enable naxsi on this location
  36. # include /etc/nginx/naxsi.rules
  37. }
  38.  
  39. location /doc/ {
  40. alias /usr/share/doc/;
  41. autoindex on;
  42. allow 127.0.0.1;
  43. deny all;
  44. }
  45.  
  46. # Only for nginx-naxsi : process denied requests
  47. #location /RequestDenied {
  48. # For example, return an error code
  49. #return 418;
  50. #}
  51.  
  52. error_page 404 /404.html;
  53.  
  54. # redirect server error pages to the static page /50x.html
  55. #
  56. error_page 500 502 503 504 /50x.html;
  57. location = /50x.html {
  58. root /usr/share/nginx/www;
  59. }
  60.  
  61. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  62. #
  63. location ~ \.php$ {
  64. try_files $uri =404;
  65. fastcgi_pass unix:/var/run/php5-fpm.sock;
  66. fastcgi_index index.php;
  67. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  68. include fastcgi_params;
  69.  
  70. # fastcgi_split_path_info ^(.+\.php)(/.+)$;
  71. # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  72. #
  73. # # With php5-cgi alone:
  74. # fastcgi_pass 127.0.0.1:9000;
  75. # # With php5-fpm:
  76. # fastcgi_pass unix:/var/run/php5-fpm.sock;
  77. # fastcgi_index index.php;
  78. # include fastcgi_params;
  79. }
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86. # deny access to .htaccess files, if Apache's document root
  87. # concurs with nginx's one
  88. #
  89. #location ~ /\.ht {
  90. # deny all;
  91. #}
  92.  
  93.  
  94.  
  95. ## Disable viewing .htaccess & .htpassword
  96. location ~ /\.ht {
  97. deny all;
  98. }
  99.  
  100.  
  101.  
  102.  
  103.  
  104. }
  105.  
  106.  
  107.  
  108. # another virtual host using mix of IP-, name-, and port-based configuration
  109. #
  110. #server {
  111. # listen 8000;
  112. # listen somename:8080;
  113. # server_name somename alias another.alias;
  114. # root html;
  115. # index index.html index.htm;
  116. #
  117. # location / {
  118. # try_files $uri $uri/ /index.html;
  119. # }
  120. #}
  121.  
  122.  
  123. # HTTPS server
  124. #
  125. #server {
  126. # listen 443;
  127. # server_name localhost;
  128. #
  129. # root html;
  130. # index index.html index.htm;
  131. #
  132. # ssl on;
  133. # ssl_certificate cert.pem;
  134. # ssl_certificate_key cert.key;
  135. #
  136. # ssl_session_timeout 5m;
  137. #
  138. # ssl_protocols SSLv3 TLSv1;
  139. # ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
  140. # ssl_prefer_server_ciphers on;
  141. #
  142. # location / {
  143. # try_files $uri $uri/ /index.html;
  144. # }
  145. #}
Advertisement
Add Comment
Please, Sign In to add comment