Skip to content

Instantly share code, notes, and snippets.

@Tupsi
Forked from exodus4d/pathfinder.conf
Last active March 12, 2016 22:44
Show Gist options
  • Save Tupsi/3c9926db715eb1dd25ac to your computer and use it in GitHub Desktop.
Save Tupsi/3c9926db715eb1dd25ac to your computer and use it in GitHub Desktop.
pathfinder.conf for Pathfinder (Nginx v.1.9.9)
# www to non-www redirect -- duplicate content is BAD:
# https://github.com/h5bp/html5-boilerplate/blob/5370479476dceae7cc3ea105946536d6bc0ee468/.htaccess#L362
# Choose between www and non-www, listen on the *wrong* one and redirect to
# the right one -- http://wiki.nginx.org/Pitfalls#Server_Name
# rewrite to HTTPS
server {
listen 80;
server_name www.pathfinder-w.space;
return 301 https://www.$server_name$request_uri;
}
# rewrite to www. HTTPS
server{
listen 80;
listen [::]:443 ssl http2;
listen 443 ssl http2;
server_name pathfinder-w.space;
# SSL =======================================================================================================================
# Certificate rooth
ssl_certificate /var/www/pathfinder.com/ssl/www.pathfinder-w.space.chained.crt;
ssl_certificate_key /var/www/pathfinder.com/ssl/pathfinder-w.space.key;
return 301 https://www.$server_name$request_uri;
}
# listen to HTTPS:/www.pathfinder-w.space (HTTP/2 protocol)
server {
listen [::]:443 ssl http2;
listen 443 ssl http2;
# The host name to respond
server_name www.pathfinder-w.space;
# Path to static files
root /var/www/pathfinder.com/public_html;
# index index.php index.html index.htm;
# Specify a charset
charset utf-8;
# enable IGB Header data
underscores_in_headers on;
# SSL =======================================================================================================================
# Certificate rooth
ssl_certificate /var/www/pathfinder.com/ssl/www.pathfinder-w.space.chained.crt;
ssl_certificate_key /var/www/pathfinder.com/ssl/pathfinder-w.space.key;
## Include the basic SSL h5bp config set
include h5bp/directive-only/ssl.conf;
# Logging ===================================================================================================================
access_log /var/www/pathfinder.com/public_html/logs/nginx_access.log main if=$log_production;
error_log /var/www/pathfinder.com/public_html/logs/nginx_error.log error;
# secure config files
location ^~ /app {
deny all;
return 404;
}
location / {
index index.php;
try_files $uri $uri/ /index.php?$query_string;
}
# location /setup {
# auth_basic "Setup Login";
# auth_basic_user_file /etc/nginx/.setup_pass;
# try_files $uri $uri/ /index.php?$query_string;
# }
# PHP socket configuration
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Include the basic h5bp config set
include h5bp/basic.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment