Advertisement
Guest User

Untitled

a guest
Aug 14th, 2012
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 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/gerson/public_html;
  25. #root /usr/share/nginx/www;
  26. index index.php index.html index.htm;
  27.  
  28. # Make site accessible from http://localhost/
  29. server_name localhost;
  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. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  65. # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  66. #
  67. # # With php5-cgi alone:
  68. fastcgi_pass 127.0.0.1:9000;
  69. # # With php5-fpm:
  70. # fastcgi_pass unix:/var/run/php5-fpm.sock;
  71. fastcgi_index index.php;
  72. include fastcgi_params;
  73. }
  74.  
  75. # deny access to .htaccess files, if Apache's document root
  76. # concurs with nginx's one
  77. #
  78. #location ~ /\.ht {
  79. # deny all;
  80. #}
  81. }
  82.  
  83.  
  84. # another virtual host using mix of IP-, name-, and port-based configuration
  85. #
  86. #server {
  87. # listen 8000;
  88. # listen somename:8080;
  89. # server_name somename alias another.alias;
  90. # root html;
  91. # index index.html index.htm;
  92. #
  93. # location / {
  94. # try_files $uri $uri/ /index.html;
  95. # }
  96. #}
  97.  
  98.  
  99. # HTTPS server
  100. #
  101. server {
  102. listen 443;
  103. server_name localhost;
  104.  
  105. root /home/gerson/public_html;
  106. index index.php index.html index.htm;
  107.  
  108. ssl on;
  109. ssl_certificate /etc/ssl/certs/server.crt;
  110. ssl_certificate_key /etc/ssl/private/server.key;
  111. #
  112. # ssl_session_timeout 5m;
  113. #
  114. # ssl_protocols SSLv3 TLSv1;
  115. # ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
  116. # ssl_prefer_server_ciphers on;
  117. #
  118. location / {
  119. try_files $uri $uri/ /index.html;
  120. }
  121.  
  122. location ~ \.php$ {
  123. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  124. fastcgi_pass 127.0.0.1:9000;
  125. fastcgi_index index.php;
  126. include fastcgi_params;
  127. }
  128. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement