Created
October 20, 2009 12:05
-
-
Save hipertracker/214210 to your computer and use it in GitHub Desktop.
NGinx -> TorqueBox
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
| /etc/hosts: | |
| 127.0.0.2 homepage jboss_server | |
| 127.0.0.4 mydomain | |
| NGINX: | |
| /etc/nginx/sites-enabled/mydomain.conf: | |
| server { | |
| listen mydomain:80; | |
| server_name mydomain; | |
| location / { | |
| if (-f $request_filename) { | |
| access_log off; | |
| expires 30d; | |
| break; | |
| } | |
| proxy_redirect off; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header Host $http_host; | |
| proxy_set_header "ENABLE_X_ACCEL_REDIRECT" "true"; | |
| proxy_pass http://homepage:8080; | |
| } | |
| } | |
| TEST | |
| Starting JBoss: | |
| $ $TORQUEBOX_HOME/jboss/run.sh -c web -b jboss_server | |
| $ elinks http://jboss_server:8080 | |
| returns error404, but it is fine because I removed root.war file | |
| $ elinks http://homepage:8080 | |
| works fine, it opens Ruby on Rails application | |
| $ elinks http://mydomain | |
| returns error404. It looks like it opens http://127.0.0.2:8080 | |
| or http://jboss_server:8080.. (JBoss distinguish between http://homepage:8080 | |
| and http://127.0.0.2:8080 even if it is the same IP). | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nowadays even this barebones nginx.conf works.