Skip to content

Instantly share code, notes, and snippets.

@ardziej
Created December 5, 2017 10:28
Show Gist options
  • Save ardziej/76620eb96d120c99783b97a91dc141ef to your computer and use it in GitHub Desktop.
Save ardziej/76620eb96d120c99783b97a91dc141ef to your computer and use it in GitHub Desktop.
server {
listen 80;
listen [::]:80;
server_name domain.local www.domain.local;
return 301 https://domain.local$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
#include snippets/ssl-domain.local.conf;
#include snippets/ssl-params.conf;
ssl on;
ssl_certificate /etc/ssl/domain.local.crt;
ssl_certificate_key /etc/ssl/domain.local.key;
server_name www.domain.local;
return 301 https://domain.local$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
#include snippets/ssl-domain.local.conf;
#include snippets/ssl-params.conf;
ssl on;
ssl_certificate /etc/ssl/domain.local.crt;
ssl_certificate_key /etc/ssl/domain.local.key;
disable_symlinks off;
root /home/users/domain/app/public;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name domain.local;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
include fastcgi_params;
}
location ~ /.well-known {
allow all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment