Skip to content

Instantly share code, notes, and snippets.

@michiels
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save michiels/56e64dad9ecb21150de2 to your computer and use it in GitHub Desktop.
Save michiels/56e64dad9ecb21150de2 to your computer and use it in GitHub Desktop.
Ideas for custom server configs
server {
listen 80;
server_name intercityup.com intercityup.nl www.intercityup.com www.intercityup.nl;
root /u/apps/intercity_site_production/current/public;
passenger_enabled on;
passenger_app_env production;
}
server {
listen 443 default_server ssl;
server_name intercityup.com intercityup.nl www.intercityup.com www.intercityup.nl;
ssl_certificate xxx.crt;
ssl_certificate_key yyy.key;
root /u/apps/intercity_site_production/current/public;
try_files $uri @passenger;
location @passenger {
passenger_enabled on;
passenger_app_env production;
}
location ^~ /blog {
root /u/apps/intercity_blog;
index index.php;
try_files $uri $uri/ /blog/index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/u/apps/intercity_blog/intercity_blog.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
location ~ ^/binaries(/.*|$) {
alias /srv/binaries/$1;
autoindex on;
autoindex_exact_size off;
}
location ~ ^/(assets)/ {
root /u/apps/intercity_site_production/current/public;
gzip_static on;
expires max;
add_header Cache-Control public;
}
}
server {
listen 80;
server_name intercityup.com intercityup.nl www.intercityup.com www.intercityup.nl;
root /u/apps/intercity_site_production/current/public;
passenger_enabled on;
passenger_app_env production;
include domains/intercityup.com.conf
}
server {
listen 443 default_server ssl;
server_name intercityup.com intercityup.nl www.intercityup.com www.intercityup.nl;
ssl_certificate xxx.crt;
ssl_certificate_key yyy.key;
root /u/apps/intercity_site_production/current/public;
try_files $uri @passenger;
location @passenger {
passenger_enabled on;
passenger_app_env production;
}
include domains/intercityup.com.ssl.conf;
}
location ^~ /blog {
root /u/apps/intercity_blog;
index index.php;
try_files $uri $uri/ /blog/index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/u/apps/intercity_blog/intercity_blog.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
location ~ ^/binaries(/.*|$) {
alias /srv/binaries/$1;
autoindex on;
autoindex_exact_size off;
}
location ~ ^/(assets)/ {
root /u/apps/intercity_site_production/current/public;
gzip_static on;
expires max;
add_header Cache-Control public;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment