upstream jatos-backend { server 127.0.0.1:9000; } # needed for websockets map $http_upgrade $connection_upgrade { default upgrade; '' close; } # redirect http to https server { listen 80; server_name www.tcoding.tech; rewrite ^ https://www.tcoding.tech$request_uri? permanent; } server { listen 80; listen 443 ssl http2; server_name tcoding.tech www.tcoding.tech; index index.php index.html index.htm default.php default.htm default.html; root /www/wwwroot/tcoding.tech; #error_page 404/404.html; ssl_certificate /www/server/panel/vhost/cert/tcoding.tech/fullchain.pem; ssl_certificate_key /www/server/panel/vhost/cert/tcoding.tech/privkey.pem; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; error_page 497 https://$host$request_uri; #SSL-END # websocket location (JATOS' group and batch channel and the test page) location ~ "/(jatos/testWebSocket|publix/[\d]+/(group/join|batch/open))" { proxy_pass http://jatos-backend; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_connect_timeout 7d; # keep open for 7 days even without any transmission proxy_send_timeout 7d; proxy_read_timeout 7d; } #ERROR-PAGE-START #error_page 404 /404.html; #error_page 502 /502.html; #ERROR-PAGE-END #PHP-INFO-START location ~ /purge(/.*) { proxy_cache_purge cache_one $host$1$is_args$args; #access_log /www/wwwlogs/tcoding.tech_purge_cache.log; } include /www/server/panel/vhost/nginx/proxy/tcoding.tech/*.conf; include enable-php-00.conf; #PHP-INFO-END #REWRITE-START include /www/server/panel/vhost/rewrite/tcoding.tech.conf; #REWRITE-END #Forbidden menu location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md) { return 404; } #SSL Certificate location ~ \.well-known{ allow all; } access_log /www/wwwlogs/tcoding.tech.log; error_log /www/wwwlogs/tcoding.tech.error.log; }