Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save konzeptual/364346 to your computer and use it in GitHub Desktop.
Save konzeptual/364346 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name www.your-website.com;
rewrite ^(.*) http://your-website.com$1 permanent;
}
server {
listen 80;
server_name your-website.com;
access_log logs/your-website.com.log;
client_max_body_size 3M;
root /path/to/your-website.com/current/public;
#####################
# Rails
#####################
location / {
rails_env staging; # this is a staging server
passenger_enabled on; # <--- don't forget this!
}
#####################
# Wordpress. I assume you installed in RAILS_ROOT/public/txt
#####################
location /txt {
passenger_enabled off;
index index.html index.php;
# following works for wordpress
# you might need to tweak it for your php-app
try_files $uri $uri/ /txt/index.php?q=$uri;
}
# serve the app via fastcgi
location ~ \.php$ {
passenger_enabled off;
fastcgi_pass 127.0.0.1:XXXXX
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /opt/nginx/conf/fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment