-
-
Save jamieshepherd/4ff5430ddb13ed04f22c to your computer and use it in GitHub Desktop.
Other
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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