Advertisement
METAJIJI

nginx to apache proxy

Apr 19th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.64 KB | None | 0 0
  1. server {
  2.     listen 80;
  3.     server_name site.ltd;
  4.  
  5.     access_log /var/log/nginx/site.ltd_http_access.log;
  6.     error_log /var/log/nginx/site.ltd_http_error.log;
  7.  
  8.     root /var/www/site;
  9.     client_max_body_size 0;
  10.  
  11.     location / {
  12.         try_files $uri @app;
  13.     }
  14.  
  15.     location @app {
  16.         proxy_pass http://127.0.0.1:8080/;
  17.         proxy_buffering on;
  18.         proxy_redirect off;
  19.         proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
  20.  
  21.         ### Set headers ####
  22.         proxy_set_header Host $http_host;
  23.         proxy_set_header X-Real-IP $remote_addr;
  24.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  25.         proxy_set_header X-Forwarded-Proto $scheme;
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement