This helps you develop react apps through a sub domain secured by ssl through nginx without much hassle. Current config from Laragon on Windows
server {
listen 80;
listen 443 ssl;
server_name app.sparkwave.test;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://localhost:3000;
# the following two timeout rules fix CRA WDS disconnects after 60s
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# Enable SSL
ssl_certificate "C:/laragon/etc/ssl/laragon.crt";
ssl_certificate_key "C:/laragon/etc/ssl/laragon.key";
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
ssl_prefer_server_ciphers on;
# Enable HSTS
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
charset utf-8;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\.ht {
deny all;
}
}
# This file is auto-generated.
# If you want Laragon to respect your changes, just remove the [auto.] prefix