Last active
August 29, 2015 14:06
-
-
Save merk/1a3a3043f8e844d684e0 to your computer and use it in GitHub Desktop.
Development NGINX config
This file contains hidden or 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
# Added to the end of fastcgi_params | |
fastcgi_buffer_size 128k; | |
fastcgi_buffers 4 256k; | |
fastcgi_busy_buffers_size 256k; |
This file contains hidden or 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
#user nobody; | |
worker_processes 1; | |
error_log /usr/local/logs/error.log; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
client_max_body_size 128M; | |
proxy_buffer_size 128k; | |
proxy_buffers 4 256k; | |
proxy_busy_buffers_size 256k; | |
upstream php { | |
server 127.0.0.1:9000; | |
} | |
include /usr/local/etc/nginx/sites/*.conf; | |
} | |
This file contains hidden or 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
# A vhost that handles React/javascript style applications | |
# that have a router prefix of /p/ | |
server { | |
listen 80; | |
server_name portal.tim; | |
root /Users/tim/Sites/$host; | |
location = / { | |
return 301 /p/; | |
} | |
location ~ ^/p/ { | |
try_files /index.html /index.html; | |
} | |
} | |
server { | |
listen 443 ssl; | |
server_name portal.tim; | |
ssl_certificate /Users/tim/Sites/wildcard.tim.crt; | |
ssl_certificate_key /Users/tim/Sites/wildcard.tim.key; | |
charset utf-8; | |
root /Users/tim/Sites/$host; | |
location = / { | |
return 301 /p/; | |
} | |
location ~ ^/p/ { | |
try_files /index.html /index.html; | |
} | |
} |
This file contains hidden or 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
# Runs any php | |
server { | |
listen 80; | |
server_name graphs.tim; | |
root /Users/tim/Sites/$host/web; | |
location ~ \.php(/|$) { | |
fastcgi_split_path_info ^(.+\.php)(.*)$; | |
fastcgi_pass php; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param HTTPS on; | |
} | |
} | |
server { | |
listen 443 ssl; | |
server_name graphs.tim; | |
ssl_certificate /Users/tim/Sites/wildcard.tim.crt; | |
ssl_certificate_key /Users/tim/Sites/wildcard.tim.key; | |
root /Users/tim/Sites/$host/web; | |
location ~ \.php(/|$) { | |
fastcgi_split_path_info ^(.+\.php)(.*)$; | |
fastcgi_pass php; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param HTTPS on; | |
} | |
} |
This file contains hidden or 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
# A default symfony2 vhost for 80 and 443 | |
server { | |
listen 80 default_server; | |
server_name _; | |
root /Users/tim/Sites/$host/web; | |
location = / { | |
try_files @site @site; | |
} | |
location / { | |
try_files $uri $uri/ @site; | |
} | |
location ~ \.php$ { | |
return 404; | |
} | |
location @site { | |
fastcgi_pass php; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root/app_dev.php; | |
} | |
} | |
server { | |
listen 443 ssl default_server; | |
server_name localhost _; | |
ssl_certificate /Users/tim/Sites/wildcard.tim.crt; | |
ssl_certificate_key /Users/tim/Sites/wildcard.tim.key; | |
root /Users/tim/Sites/$host/web; | |
location = / { | |
try_files @site @site; | |
} | |
location / { | |
try_files $uri $uri/ @site; | |
} | |
location ~ \.php$ { | |
return 404; | |
} | |
location @site { | |
fastcgi_pass php; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root/app_dev.php; | |
fastcgi_param HTTPS on; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment