notebook/IT/HTTP/Nginx.md
vincent a065caf8cc
All checks were successful
continuous-integration/drone/push Build is passing
correct uppercase
2022-10-09 17:11:12 +02:00

24 lines
1.0 KiB
Markdown

# nginx
## reverse proxy
```nginx
location /chainetv {
proxy_pass http://unix:/run/gunicorn/socket:/;
#proxy_set_header Host $host;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-Scheme $scheme;
#proxy_set_header X-Script-Name /chainetv;
}
```
- le :/ aprés le socket sert a envoyer le sous répertoire a la suite de l'adresse demander l'appli écoute donc la route /api
- la parie commenté a le même fonctionnement mais permet un réglage plus fin associer a flask et la classe ReverseProxied par exemple:
la location peut rediriger /chaine/api en metant le X-Script-ame a /chainetv l'appli peut donc écouter la route /api
## Links
- [Nginx configuration generator](https://github.com/valentinxxx/nginxconfig.io)
- [Nginx Quick Reference](https://github.com/trimstray/nginx-quick-reference) ([HN](https://news.ycombinator.com/item?id=19112090)) - Notes describes how to improve Nginx performance, security and other important things.