phpinfo-ssl.conf 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. # https://www.nginx.com/resources/wiki/start/
  5. # https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
  6. # https://wiki.debian.org/Nginx/DirectoryStructure
  7. #
  8. # In most cases, administrators will remove this file from sites-enabled/ and
  9. # leave it as reference inside of sites-available where it will continue to be
  10. # updated by the nginx packaging team.
  11. #
  12. # This file will automatically load configuration files provided by other
  13. # applications, such as Drupal or Wordpress. These applications will be made
  14. # available underneath a path with that package name, such as /drupal8.
  15. #
  16. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  17. ##
  18. server {
  19. listen 80;
  20. listen [::]:80;
  21. server_name localhost;
  22. # Redirect HTTP to HTTPS
  23. return 301 https://$host$request_uri;
  24. }
  25. server {
  26. # SSL configuration
  27. #
  28. listen 443 ssl;
  29. listen [::]:443;
  30. ssl_certificate /etc/nginx/ssl/localhost.crt;
  31. ssl_certificate_key /etc/nginx/ssl/localhost.key;
  32. #
  33. # Note: You should disable gzip for SSL traffic.
  34. # See: https://bugs.debian.org/773332
  35. gzip off;
  36. #
  37. # Read up on ssl_ciphers to ensure a secure configuration.
  38. # See: https://bugs.debian.org/765782
  39. root /var/www/html;
  40. # Add index.php to the list if you are using PHP
  41. index index.html index.htm index.php;
  42. server_name localhost;
  43. location / {
  44. # First attempt to serve request as file, then
  45. # as directory, then fall back to displaying a 404.
  46. try_files $uri $uri/ =404;
  47. }
  48. # pass PHP scripts to FastCGI server
  49. #
  50. location ~ \.php$ {
  51. include snippets/fastcgi-php.conf;
  52. #
  53. # With php-fpm (or other unix sockets):
  54. fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  55. }
  56. # deny access to .htaccess files
  57. #
  58. #location ~ /\.ht {
  59. # deny all;
  60. #}
  61. }