Advertisement
Guest User

Full Config File

a guest
Sep 9th, 2014
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.40 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 default_server;
  22.         listen 127.0.0.1:8080; ## listen for ipv4; this line is default and implied
  23.         listen [::]:80 default_server ipv6only=on;
  24.         port_in_redirect off;
  25.         root /var/www/html;
  26.         index index.php index.html index.htm;
  27.  
  28.         # Make site accessible from http://localhost/
  29.         server_name http://128.199.183.104;
  30.  
  31.         location / {
  32.                 # First attempt to serve request as file, then
  33.                 # as directory, then fall back to displaying a 404.
  34.                 #try_files $uri $uri/ =404;
  35.                 try_files $uri $uri/ /index.php?q=$uri&$args;
  36.                 # Uncomment to enable naxsi on this location
  37.                 # include /etc/nginx/naxsi.rules
  38.         }
  39.  
  40.         # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
  41.         #location /RequestDenied {
  42.         #       proxy_pass http://127.0.0.1:8080;
  43.         #}
  44.  
  45.         error_page 404 /404.html;
  46.  
  47.         # redirect server error pages to the static page /50x.html
  48.         #
  49.         error_page 500 502 503 504 /50x.html;
  50.         location = /50x.html {
  51.                 root /usr/share/nginx/html;
  52.         }
  53.  
  54.         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  55.         #
  56.         location ~ \.php$ {
  57.                 try_files $uri =404;
  58.                 fastcgi_split_path_info ^(.+\.php)(/.+)$;
  59.         #       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  60.         #
  61.         #       # With php5-cgi alone:
  62.         #       fastcgi_pass 127.0.0.1:9000;
  63.         #       # With php5-fpm:
  64.                 fastcgi_pass unix:/var/run/php5-fpm.sock;
  65.                 fastcgi_index index.php;
  66.                 include fastcgi_params;
  67.         }
  68.  
  69.         # deny access to .htaccess files, if Apache's document root
  70.         # concurs with nginx's one
  71.         #
  72.         #location ~ /\.ht {
  73.         #       deny all;
  74.         #}
  75. }
  76.  
  77.  
  78. # another virtual host using mix of IP-, name-, and port-based configuration
  79. #
  80. #server {
  81. #       listen 8000;
  82. #       listen somename:8080;
  83. #       server_name somename alias another.alias;
  84. #       root html;
  85. #       index index.html index.htm;
  86. #
  87. #       location / {
  88. #               try_files $uri $uri/ =404;
  89. #       }
  90. #}
  91.  
  92.  
  93. # HTTPS server
  94. #
  95. #server {
  96. #       listen 443;
  97. #       server_name localhost;
  98. #
  99. #       root html;
  100. #       index index.html index.htm;
  101. #
  102. #       ssl on;
  103. #       ssl_certificate cert.pem;
  104. #       ssl_certificate_key cert.key;
  105. #
  106. #       ssl_session_timeout 5m;
  107. #
  108. #       ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
  109. #       ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
  110. #       ssl_prefer_server_ciphers on;
  111. #
  112. #       location / {
  113. #               try_files $uri $uri/ =404;
  114. #       }
  115. #}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement