Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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