2023-02-11 00:18:51 +01:00
|
|
|
# Configurer HTTP IPv4
|
2023-02-10 23:51:43 +01:00
|
|
|
|
2023-02-11 00:18:51 +01:00
|
|
|
Afin d'économiser des adresses IPv4, le flux HTTP IPv4 est mutualisé sur une seule IP.
|
|
|
|
En conséquence, une étape de proxy est nécessaire.
|
|
|
|
|
|
|
|
Enrichir le fichier ̀`leparc.libre-en-communs.org:/etc/nginx/reverse_proxy.conf` :
|
|
|
|
```
|
|
|
|
server {
|
|
|
|
server_name foo.a-lec.org;
|
|
|
|
listen 80;
|
|
|
|
proxy_redirect off;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
set $target "http://foo.a-lec.org:80";
|
|
|
|
proxy_pass $target;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Enrichir le fichier ̀`leparc.libre-en-communs.org:/etc/nginx/reverse_proxy_ssl.conf` :
|
|
|
|
```
|
|
|
|
map $ssl_preread_server_name $name_444 {
|
|
|
|
[…]
|
|
|
|
foo.a-lec.org foo_a-lec_444;
|
|
|
|
[…]
|
|
|
|
}
|
|
|
|
[…]
|
|
|
|
upstream foo_a-lec_444 {
|
|
|
|
server foo.a-lec.org:444;
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Vérifier la configuration :
|
|
|
|
```
|
|
|
|
nginx -t
|
|
|
|
```
|
|
|
|
|
|
|
|
Redémarrer nginx :
|
|
|
|
```
|
|
|
|
service nginx restart
|
|
|
|
```
|