Advertisement
Guest User

host nginx gf.net

a guest
Sep 4th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 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;
  18. listen [::]:80;
  19. if ($scheme != "https") {
  20. rewrite ^ https://info.domain.tld$request_uri? permanent;
  21. }
  22. # SSL configuration
  23. #
  24. listen 443 ssl;
  25. listen [::]:443 ssl;
  26. ssl on;
  27. ssl_certificate /etc/nginx/ssl/zertifikat.pem;
  28. ssl_certificate_key /etc/nginx/ssl/privaterkey.pem;
  29. #
  30. # Self signed certs generated by the ssl-cert package
  31. # Don't use them in a production server!
  32. #
  33. # include snippets/snakeoil.conf;
  34.  
  35. root /var/www/infopage;
  36.  
  37. # Add index.php to the list if you are using PHP
  38. index index.html index.php index.htm index.nginx-debian.html;
  39.  
  40. server_name info.domain.tld;
  41.  
  42. location / {
  43. # First attempt to serve request as file, then
  44. # as directory, then fall back to displaying a 404.
  45. try_files $uri $uri/ =404;
  46. }
  47.  
  48. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  49. #
  50. location ~ \.php$ {
  51. # include snippets/fastcgi-php.conf;
  52. #
  53. # # With php5-cgi alone:
  54. fastcgi_pass 127.0.0.1:9000;
  55. # # With php5-fpm:
  56. try_files $uri =404;
  57. # fastcgi_pass unix:/var/run/php5-fpm.sock;
  58. # fastcgi_index index.php;
  59. include fastcgi.conf;
  60. }
  61.  
  62. # deny access to .htaccess files, if Apache's document root
  63. # concurs with nginx's one
  64. #
  65. #location ~ /\.ht {
  66. # deny all;
  67. #}
  68. }
  69.  
  70.  
  71. # Virtual Host configuration for example.com
  72. #
  73. # You can move that to a different file under sites-available/ and symlink that
  74. # to sites-enabled/ to enable it.
  75. #
  76. #server {
  77. # listen 80;
  78. # listen [::]:80;
  79. #
  80. # server_name example.com;
  81. #
  82. # root /var/www/example.com;
  83. # index index.html;
  84. #
  85. # location / {
  86. # try_files $uri $uri/ =404;
  87. # }
  88. #}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement