# Copy this this to /etc/nginx/http.d map $http_upgrade $connection_upgrade { default upgrade; '' close; } # ------------------------- # log_format custom '< $remote_addr | $time_local | ' # '$request | $status | $body_bytes_sent | ' # '$http_user_agent | ' # '$http_x_forwarded_for | ' # '$proxy_add_x_forwarded_for | $scheme | ' # '$http_host | $http_upgrade | $http_connection >'; # access_log /var/log/nginx/all.log custom; # # error_log /var/log/nginx/all.log; # error_log /var/log/nginx/all.log debug; # ------------------------- server { listen 80 default_server; # listen 80 default_server so_keepalive=on; # listen 80; # server_name xxx.arvancaas.ir; client_header_timeout 1071906480m; keepalive_timeout 1071906480m; location /test/ { return 200 'gangnam style!'; # because default content-type is application/octet-stream, # browser will offer to "save the file; so if you want to see reply in browser... add_header Content-Type text/plain; } location /adamson { proxy_pass http://localhost:7274; proxy_set_header Host $host; } location / { proxy_pass http://localhost:993; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; # ------------------ # BUG This line is IMPORTANT! Without it, iran_node's (docker@arvan) dokodemo forwaring to # foreign_node's authentication_inbound, will not work! proxy_set_header Host ""; # proxy_hide_header Host; # 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_read_timeout 300s; # proxy_connect_timeout 75s; client_body_timeout 1071906480m; client_max_body_size 0; } }