Created
April 13, 2010 05:37
-
-
Save konzeptual/364346 to your computer and use it in GitHub Desktop.
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
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