Skip to content

Instantly share code, notes, and snippets.

@jamieshepherd
Created January 20, 2016 20:25
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 jamieshepherd/4ff5430ddb13ed04f22c to your computer and use it in GitHub Desktop.
Save jamieshepherd/4ff5430ddb13ed04f22c to your computer and use it in GitHub Desktop.
Other
server {
listen 80;
server_name swellhunter.co.uk *.swellhunter.co.uk;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
# Root directory
# We're assuming laravel here, if not just /vagrant
root /web/swellhunter/public;
# Set index to php file
index index.php;
server_name swellhunter.co.uk *.swellhunter.co.uk;
# Set max body size
client_max_body_size 5M;
# Location
location / {
try_files $uri/ /index.php?$query_string;
}
# Remove trailing slash
if (!-d $request_filename){
rewrite ^/(.+)/$ /$1 permanent;
}
# Configure PHP FPM
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# Remove htaccess
location ~ /\.ht {
deny all;
}
# SSL STUFF IS HERE....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment