Skip to content

Instantly share code, notes, and snippets.

@muzafarali
Created August 22, 2017 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muzafarali/44aa90c0753faf081fdff51af2ada3af to your computer and use it in GitHub Desktop.
Save muzafarali/44aa90c0753faf081fdff51af2ada3af to your computer and use it in GitHub Desktop.
##
# Default server on https and redirect to correct URL
##
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl on;
ssl_stapling on;
ssl_stapling_verify on;
ssl_certificate /etc/ssl/thehairapp_co_uk.crt;
ssl_certificate_key /etc/ssl/thehairapp.key;
# include snippets/self-signed.conf;
# include snippets/ssl-params.conf;
server_name thehairapp.co.uk;
return 301 https://www.$server_name$request_uri;
}
##
# Hair app domain on https
##
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl on;
ssl_stapling on;
ssl_stapling_verify on;
ssl_certificate /etc/ssl/thehairapp_co_uk.crt;
ssl_certificate_key /etc/ssl/thehairapp.key;
# include snippets/self-signed.conf;
# include snippets/ssl-params.conf;
root /var/www/TheHairApp/public;
index index.php index.html index.htm;
server_name www.thehairapp.co.uk;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
location ~ /.well-known {
allow all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment