Advertisement
Guest User

nginx

a guest
Sep 22nd, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. server_name mydomain;
  5. return 301 https://$host$request_uri;
  6. }
  7. server {
  8. listen 443 ssl;
  9. listen [::]:443 ssl;
  10.  
  11. server_name mydomain;
  12.  
  13. ssl_certificate /etc/letsencrypt/live/mydomain/fullchain.pem;
  14. ssl_certificate_key /etc/letsencrypt/live/mydomain/privkey.pem;
  15. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  16. ssl_prefer_server_ciphers on;
  17. ssl_dhparam /etc/ssl/certs/dhparam.pem;
  18. ssl_ciphers 'unwichtig';
  19. ssl_session_timeout 1d;
  20. ssl_session_cache shared:SSL:50m;
  21. ssl_stapling on;
  22. ssl_stapling_verify on;
  23. add_header Strict-Transport-Security max-age=15768000;
  24.  
  25. root /var/www/mydomain;
  26.  
  27. index index.php index.html index.htm;
  28.  
  29. location / {
  30. try_files $uri $uri/ =404;
  31. }
  32.  
  33. location ~ \.php$ {
  34. include snippets/fastcgi-php.conf;
  35. fastcgi_pass unix:/var/run/php5-fpm.sock;
  36. }
  37.  
  38. location ~ /\.ht {
  39. deny all;
  40. }
  41.  
  42. location ~ /.well-known {
  43. allow all;
  44. }
  45. }
  46. server {
  47. listen 80;
  48. listen [::]:80;
  49.  
  50. server_name pma.mydomain;
  51.  
  52. root /var/www/phpmyadmin;
  53.  
  54. index index.php index.html index.htm;
  55.  
  56. location / {
  57. try_files $uri $uri/ =404;
  58. allow 127.0.0.1;
  59. allow unwichtig;
  60. allow unwichtig;
  61. deny all;
  62. }
  63.  
  64. location ~ /robots.txt {
  65. allow all;
  66. }
  67.  
  68. location ~ \.php$ {
  69. include snippets/fastcgi-php.conf;
  70. fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  71. fastcgi_read_timeout 60;
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement