# Run as a less privileged user for security reasons. user nginx; # #worker_threads to run; # "auto" sets it to the #CPU_cores available in the system, and # offers the best performance. worker_processes auto; events { worker_connections 1024; } http { # Other HTTP-related configurations # Définir la taille maximale de la requête à illimité client_max_body_size 0; server { server_tokens off; listen 80; server_name comparateur.slc-assurances.fr ; root /usr/share/nginx/html; include /etc/nginx/mime.types; location ~ /.well-known/acme-challenge { allow all; root /usr/share/nginx/html/letsencrypt; } # redirect http to https #return 301 https://comparateur.slc-assurances.fr$request_uri; return 301 https://$host:8443$request_uri; } server { listen [::]:443 ssl http2; listen 443 ssl http2; server_name comparateur.slc-assurances.fr; #// SSL code/ ssl_certificate /etc/nginx/ssl/live/comparateur.slc-assurances.fr/fullchain.pem; ssl_certificate_key /etc/nginx/ssl/live/comparateur.slc-assurances.fr/privkey.pem; root /usr/share/nginx/html; include /etc/nginx/mime.types; location / { try_files $uri $uri/ /index.html; #proxy_pass http://frontcontainer:80; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # Add these lines for debugging #proxy_connect_timeout 600; #proxy_send_timeout 600; #proxy_read_timeout 600; #send_timeout 600; } location /api/ { proxy_pass http://springcontainer:8085/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } gzip on; gzip_vary on; gzip_http_version 1.0; gzip_comp_level 5; gzip_types application/atom+xml application/javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/plain text/x-component; gzip_proxied no-cache no-store private expired auth; gzip_min_length 256; gunzip on; } server { server_tokens off; listen 80; server_name scraping.slassurances.fr ; root /usr/share/nginx/html; include /etc/nginx/mime.types; location ~ /.well-known/acme-challenge { allow all; root /usr/share/nginx/html/letsencrypt; } # Commenter cette ligne pendant la validation Certbot return 301 https://$host$request_uri; } # HTTPS configuration for scraping.slassurances.fr server { listen [::]:443 ssl http2; listen 443 ssl http2; server_name scraping.slassurances.fr; ssl_certificate /etc/nginx/ssl/live/scraping.slassurances.fr/fullchain.pem; ssl_certificate_key /etc/nginx/ssl/live/scraping.slassurances.fr/privkey.pem; root /usr/share/nginx/html; include /etc/nginx/mime.types; location / { proxy_pass http://flaskcontainer:5001/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600; } gzip on; gzip_vary on; gzip_http_version 1.0; gzip_comp_level 5; gzip_types application/atom+xml application/javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/woff font/woff2 image/svg+xml image/x-icon text/css text/plain text/x-component; } }