Bonjour,
J'ai installé un serveur nginx pour effectuer une terminaison SSL / TLS qui retransmet ensuite toutes les demandes à un serveur proxy interne pour faire de l'autentification avec auth0.
Le serveur nginx fonctionne, j'arrive à accèder à la pages d'accueil. J'ai installé nodejs et auth0, j'arrive à accèder à la page d'autentification. Tout fonctionne indépendamment ^^. Puis quand j'essaye de tout assembler ca ne marche pas.
Ce que je fais
/etc/nginx/nginx.conf
events {
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# Listen on port 80 and redirect all requests to the
# TLS enabled server (https, port 443)
server {
listen *:80;
# Your hostname should go here
server_name localhost;
access_log off;
location / {
rewrite ^ https://$host$request_uri? permanent;
}
}
# TLS enabled server
server {
listen 443 ssl;
# Your hostname should go here
server_name localhost;
# TLS/SSL certificates for your secure server should go here.
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
# To enhance security, as long as you don't need to support older browsers
# (and you probably don't), you should only enable the most secure
# ciphers and algorithms. This is a sane selection.
ssl_ciphers ""EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"";
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache builtin:1000 shared:SSL:10m;
# This proxies requests to our shiny-auth0 authentication proxy.
# Requests are passed in plain HTTP, so TLS termination
# is applied at this point.
location / {
proxy_set_header Host $host;
# This points to our shiny-auth0 authentication proxy,
# change localhost:3000 to suit the configuration of
# your shiny-auth0 config
proxy_pass http://127.0.0.1:3000;
proxy_redirect http://127.0.0.1:3000/ $scheme://$host/;
proxy_http_version 1.1;
# The following lines enable WebSockets proxying, do not remove them
# as they are used by Shiny Server to improve user experience
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_connect_timeout 3h;
proxy_send_timeout 3h;
proxy_read_timeout 3h;
}
}
}
Ce que je veux
Je voudrais quand on tape l'adresse du serveur nginx, il redirige vers la page d'autentification de auth0
Ce que j'obtiens
/var/log/nginx/error.log
2018/01/23 06:53:38 [crit] 1545#0: *3 connect() to 127.0.0.1:3000 failed (13: Permis
sion denied) while connecting to upstream, client: 191.250.99.150, server: $localho
st, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "30.200.131
.212"