• [^] # Re: config reseau

    Posté par . En réponse au message Aide configuration réseau Nginx + Turtl : serveur de notes. Évalué à 1.

    J'ai mis pour le fichier de config de Nginx et de turtl :
    IP 192.168.1.40
    port 8181

    Sur le client turtl l'adresse à rentrer est :
    http://serveur.domaine.fr:8181

    et la sortie de lsof -i :8181

     root@raspberrypi:/home/pi# nano /var/www/turtl/api/config/config.lisproot@raspberrypi:/home/pi# lsof -i :8181
     COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
     armcl 2518 www-data 12u IPv4 41183 0t0 TCP raspberrypi:8181 (LISTEN)
     armcl 2518 www-data 13u IPv4 91516 0t0 TCP raspberrypi:8181->box:52897 (ESTABLISHED)
     armcl 2518 www-data 14u IPv4 91495 0t0 TCP raspberrypi:8181->android-1b4a158d033cd8e6:43183 (ESTABLISHED)
     armcl 2518 www-data 15u IPv4 88563 0t0 TCP raspberrypi:8181->jopcportable:36121 (ESTABLISHED)
     armcl 2518 www-data 16u IPv4 91585 0t0 TCP raspberrypi:8181->box:39328 (ESTABLISHED)
     armcl 2518 www-data 18u IPv4 91576 0t0 TCP raspberrypi:8181->box:52903 (ESTABLISHED)
    

    J'ai essayé de remplacer l'IP 192.168.1.60 par 127.0.0.1 mais sans succès. D'ailleurs un internaute avait précisé qu'il a du remplacer l'IP 127.0.0.1 par l'adresse IP de la raspi.

    Mais voila après je ne sais pas comment se dresse le projet, si Nginx se situe en haut ou non, ...

    Voici le fichier /etc/nginx/sites-enabled/api.notes.example.org.conf :
    ```

    upstream turtl {
     server 127.0.0.1:8181 ;
    }
    client_max_body_size 2m ;
    server {
     listen 80 ;
     listen [::]:80 ;
     #listen 443 ;
     #listen [::]:443 ;
     server_name api.notes.example.org ;
     access_log /var/log/nginx/notes.example.org-ssl.access.log ;
     error_log /var/log/nginx/notes.example.org-ssl.error.log ;
     #if ($scheme = http) {
     # return 301 https://$server_name$request_uri ;
     #}
     #ssl on ;
     #
     #ssl_certificate /etc/ssl/private/api.notes.example.org/fullchain.pem ;
     #ssl_certificate_key /etc/ssl/private/api.notes.example.org/privkey.pem ;
     #
     #ssl_ecdh_curve secp384r1 ;
     #ssl_prefer_server_ciphers on ;
     #ssl_protocols TLSv1 TLSv1.1 TLSv1.2 ; # not possible to do exclusive
     #ssl_ciphers 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH :+CAMELLIA256 :+AES256 :+CAMELLIA128 :+AES128 :+SSLv3 :!aNULL :!eNULL :!LOW :!3DES :!MD5 :!EXP :!PSK :!DSS :!RC4 :!SEED :!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA' ;
     #
     #ssl_stapling on ;
     #resolver 192.168.1.1 ;
     index index.html ;
     location / {
     proxy_set_header Host $host ;
     proxy_pass http://turtl ;
     }
    }
    

    ```Du coup je cherche encore la signification et l'utilité des lignes suivante :

    server_name api.notes.example.org ;
    proxy_pass http://turtl

    upstream turtl {
    server 127.0.0.1:8181 ;
    }

    Voila le compte rendu.