What is the url behind proxy_pass of nginx reverse proxy? The 127.0.0.1 written in the example below represents the local machine? Represent yourself? What is the function?
location / {
proxy_http_version 1.1;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
add_header X-Frame-Options deny;
add_header X-Content-Type-Options nosniff;
add_header Content-Security-Policy "default-src 'none'; script-src 'unsafe-inline' 'unsafe-eval' blob: https:; img-src data: https: http://ip.qgy18.com; style-src 'unsafe-inline' https:; child-src https:; connect-src 'self' https://translate.googleapis.com; frame-src https://disqus.com https://www.slideshare.net";
add_header Public-Key-Pins 'pin-sha256="YLh1dUR9y6Kja30RrAn7JKnbQG/uEtLMkBgFF2Fuihg="; pin-sha256="aef6IF2UF6jNEwA2pNmP7kpgT6NFSdt7Tqf5HzaIGWI="; max-age=2592000; includeSubDomains';
add_header Cache-Control no-cache;
proxy_ignore_headers Set-Cookie;
proxy_hide_header Vary;
proxy_hide_header X-Powered-By;
proxy_set_header X-Via QingDao.Aliyun;
proxy_set_header Connection "";
proxy_set_header Host imququ.com;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:9095;
}
滿天的星座2017-05-16 17:19:42
There is a port behind the IP
Forward the request to port 80 to port 9095, because nginx itself cannot handle the request of java/php/python (just for example), it needs to be handed over to tomcat, php-fpm or wsgi, etc. To handle it, so a reverse proxy backend service is needed. Personal understanding
伊谢尔伦2017-05-16 17:19:42
I think you can also write other IPs, not necessarily this machine, as long as this machine can access it
阿神2017-05-16 17:19:42
Other IPs can be used. The purpose is to realize the proxy. Simply understood as CDN, it can also be used, but the functions are complete and available
曾经蜡笔没有小新2017-05-16 17:19:42
127.0.0.1 refers to this machine, why do you need to proxy yourself? For example, the server is running node.js server, but node.js is not a dedicated web server, so Nginx is required to reverse proxy, which makes it much more convenient to control external access, and Nginx caching can improve performance.