Pointer un répertoir Vituel NGINX sous domain

Résolu/Fermé
Flash - 19 oct. 2017 à 00:14
mamiemando Messages postés 33077 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 18 avril 2024 - 26 oct. 2017 à 10:10
Bonjour,

J'ai un site web domo.monsite.fr

Ma configuration NGINX fonctionne en proxy_pass , c'est redirigé sur un server apache2

Je voulais faire un truc simple mais je n'y arrive pas


Quand je tape http://domo.monsite.fr mon server m'envoi sur l'adresse 192.168.100.1

Mais je voudrais quand je tape http://domo.monsite.fr/temp/ qu'il me renvoi sur 192.168.100.10

Mais ça j'y arrive pas ...

J'ai bien testé des paramètre avec location / . mais ca ne marche pas comme je veux


2 réponses

flashlight025
25 oct. 2017 à 19:52
Merci pour ta réponse , du coup j'ai trouvé voici ma config pour info pour d'autre personnes


server {
listen 443 ;
server_name domo.monsite.fr;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
ssl_certificate /etc/letsencrypt/live/domo.monsite.fr/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domo.monsite.fr/privkey.pem;
auth_basic "Administrator Login";

client_max_body_size 50M;

location / {
proxy_pass http://192.168.100.1/;
proxy_redirect http://domo.monsite.fr/ http://192.168.100.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}


location /domo/ {
proxy_read_timeout 300;
proxy_connect_timeout 300;


proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For

proxy_pass http://192.168.100.1:8085/;
proxy_redirect http://domo.monsite.fr/domo/ http://192.168.100.1:8085/;



}

1
mamiemando Messages postés 33077 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 18 avril 2024 7 748
26 oct. 2017 à 10:10
Merci pour ton retour ! Bonne continuation !
0
mamiemando Messages postés 33077 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 18 avril 2024 7 748
24 oct. 2017 à 21:23
Bonjour,

Difficile de répondre sans voir la configuration nginx. Mais ce lien te donne un squelette de configuration pour faire une telle redirection :
https://serverfault.com/questions/308238/redirecting-from-one-nginx-to-another

Une fois configuré, pense à relancer nginx.

Bonne chance
0