harshit96

default

Mar 14th, 2017
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. ##
  2. # You should look at the following URL's in order to grasp a solid understanding
  3. # of Nginx configuration files in order to fully unleash the power of Nginx.
  4. # http://wiki.nginx.org/Pitfalls
  5. # http://wiki.nginx.org/QuickStart
  6. # http://wiki.nginx.org/Configuration
  7. #
  8. # Generally, you will want to move this file somewhere, and start with a clean
  9. # file but keep this around for reference. Or just disable in sites-enabled.
  10. #
  11. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  12. ##
  13.  
  14. # Default server configuration
  15. #
  16. server {
  17. listen 80 default_server;
  18. listen [::]:80 default_server;
  19. server_name anonweb.org www.example.org;
  20. return 301 https://$server_name$request_uri;
  21. }
  22. server {
  23. listen 443 ssl http2 default_server;
  24. listen [::]:443 ssl http2 default_server;
  25. include snippets/ssl-example.org.conf;
  26. include snippets/ssl-params.conf;
  27. # SSL configuration
  28. #
  29. # listen 443 ssl default_server;
  30. # listen [::]:443 ssl default_server;
  31. #
  32. # Note: You should disable gzip for SSL traffic.
  33. # See: https://bugs.debian.org/773332
  34. #
  35. # Read up on ssl_ciphers to ensure a secure configuration.
  36. # See: https://bugs.debian.org/765782
  37. #
  38. # Self signed certs generated by the ssl-cert package
  39. # Don't use them in a production server!
  40. #
  41. # include snippets/snakeoil.conf;
  42.  
  43. root /home/webmaster/mainsite/;
  44.  
  45. # Add index.php to the list if you are using PHP
  46. index index.html index.htm index.nginx-debian.html;
  47.  
  48. location ~ /.well-known {
  49. allow all;
  50. }
  51. location / {
  52. # First attempt to serve request as file, then
  53. # as directory, then fall back to displaying a 404.
  54. try_files $uri $uri/ =404;
  55. }
  56.  
  57. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  58. #
  59. #location ~ \.php$ {
  60. # include snippets/fastcgi-php.conf;
  61. #
  62. # # With php7.0-cgi alone:
  63. # fastcgi_pass 127.0.0.1:9000;
  64. # # With php7.0-fpm:
  65. # fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  66. #}
  67.  
  68. # deny access to .htaccess files, if Apache's document root
  69. # concurs with nginx's one
  70. #
  71. #location ~ /\.ht {
  72. # deny all;
  73. #}
  74. }
Add Comment
Please, Sign In to add comment