I moved to https encryption using certbot Let's encrypt certificates and my config files looks like:
server {
server_name 5d61057e5e1f.sn.mynetname.net;
listen 443;
ssl on;
ssl_certificate /etc/letsencrypt/live/5d61057e5e1f.sn.mynetname.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/5d61057e5e1f.sn.mynetname.net/privkey.pem;
root /var/www/html;
index index.php index.html index.htm;
server_name _;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
To turn back http (port 80) support I need to create another server block with same content excluding SSL atribbutes (4 lines):
server {
server_name 5d61057e5e1f.sn.mynetname.net;
listen 80;
root /var/www/html;
index index.php index.html index.htm;
server_name _;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
No comments:
Post a Comment