Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 1st, 2013  |  syntax: None  |  size: 0.84 KB  |  views: 38  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. upstream firstApp{
  2.     server 127.0.0.1:8123;
  3. }
  4.  
  5. server{
  6.     server_name mydomain.com;
  7.     access_log /var/log/nginx/me.log;
  8.  
  9.     location / {
  10.         proxy_set_header X-Real-IP $remote_addr;
  11.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  12.         proxy_set_header Host $http_host;
  13.         proxy_set_header X-NginX-Proxy true;
  14.  
  15.         proxy_pass http://firstApp/;
  16.         proxy_redirect off;
  17.     }
  18. }
  19.        
  20. upstream otherapp{
  21.     server 127.0.0.1:8124;
  22. }
  23.  
  24. server{
  25.     server_name otherapp.mydomain.com;
  26.     access_log /var/log/nginx/me.log;
  27.  
  28.     location / {
  29.         proxy_set_header X-Real-IP $remote_addr;
  30.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  31.         proxy_set_header Host $http_host;
  32.         proxy_set_header X-NginX-Proxy true;
  33.  
  34.         proxy_pass http://otherapp/;
  35.         proxy_redirect off;
  36.     }
  37. }
clone this paste RAW Paste Data