A
A
alim ushurov2019-05-03 19:40:07
Nginx
alim ushurov, 2019-05-03 19:40:07

How to properly configure nginx proxy server?

Greetings! Help!
The whole day I suffer from proxying the site to the outside.
I'm trying to set up an nginx proxy server in the DMZ zone. When you try to enter the site through a proxy, the content file will be obtained Content-Type: text/html
Directly if you enter the site, the content file returns Content-Type: application/javascript and the site will load correctly.
That is, how to properly configure proxying in nginx so that it would proxy Content-Type: as it is?
Below is the config file.
server {
listen 80;
server_name domain.com;
}
server {
listen 443 ssl;
server_name domain.com;
underscores_in_headers on;
ssl_certificate /etc/letsencrypt/live/domen.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domen.com/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers -AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA;
add_header Strict-Transport-Security 'max-age=604800';
location / {
proxy_pass domain2.com/customer/login/;
}
location ^~ /customer {
proxy_pass domen2.com/;
}
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Skibin, 2019-05-03
@alim_ushurov

location / {
  proxy_pass http://192.168.0.1; // или какой у Вас там IP    
  proxy_set_header Host domen2.com;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Real-IP $remote_addr;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question