Advertisement
MertcanGokgoz

NGINX, PhpMyAdmin with SSL

Mar 14th, 2019
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.76 KB | None | 0 0
  1. server {
  2.     listen 80;
  3.     listen [::]:80;
  4.     server_name sql.mertcangokgoz.com;
  5.     return 301 https://sql.mertcangokgoz.com;
  6. }
  7.  
  8. server {
  9.     listen 443 ssl http2;
  10.     listen [::]:443 ssl http2;
  11.      
  12.     # SSL
  13.     ssl_session_timeout 1d;
  14.     ssl_session_cache shared:SSL:50m;
  15.     ssl_session_tickets off;
  16.  
  17.     # modern configuration
  18.     ssl_protocols TLSv1.2;
  19.     ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256;
  20.     ssl_prefer_server_ciphers on;
  21.  
  22.     # OCSP Stapling
  23.     ssl_stapling on;
  24.     ssl_stapling_verify on;
  25.     resolver 1.1.1.1 1.0.0.1 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=60s;
  26.     resolver_timeout 2s;
  27.  
  28.     ssl_certificate /etc/letsencrypt/live/mertcangokgoz.com/fullchain.pem;
  29.     ssl_certificate_key /etc/letsencrypt/live/mertcangokgoz.com/privkey.pem;  
  30.  
  31.     add_header Strict-Transport-Security max-age=15768000;
  32.     client_max_body_size 100M;
  33.  
  34.     set $base /var/www/mertcangokgoz.com;
  35.       root $base/sql;
  36.     index index.html index.htm index.php;
  37.  
  38.     server_name sql.mertcangokgoz.com;
  39.    
  40.  
  41.     charset utf-8;
  42.   index index.php;
  43.   location / {
  44.     try_files $uri $uri/ /index.php?$args;
  45.   }
  46.  
  47.   location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
  48.     access_log off;
  49.     expires max;
  50.   }
  51.  
  52.   location ~ /\.ht {
  53.     deny  all;
  54.   }
  55.  
  56.   location ~ \.php$ {
  57.     fastcgi_index index.php;
  58.     fastcgi_keep_conn on;
  59.     include /etc/nginx/fastcgi_params;
  60.     fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  61.     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  62.   }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement