local ssl config to enable the use of auth

This commit is contained in:
rahulramesha 2024-05-14 19:58:04 +05:30
parent ab6f1ef780
commit 6e0659cf47
3 changed files with 102 additions and 1 deletions

4
local-ssl-setup.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
cd ./nginx
mkcert local.plane.so
mkcert local.plane.tools

96
nginx/local.conf Normal file
View File

@ -0,0 +1,96 @@
events {
}
http {
sendfile on;
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate ./local.plane.so.pem;
ssl_certificate_key ./local.plane.so-key.pem;
server_name local.plane.so;
#client_max_body_size ${FILE_SIZE_LIMIT};
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Permissions-Policy "interest-cohort=()" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Forwarded-Proto "$scheme";
add_header Host "$host";
location / {
proxy_pass http://localhost:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /god-mode/ {
proxy_pass http://localhost:3333/god-mode/;
}
location /spaces/ {
rewrite ^/spaces/?$ /spaces/login break;
proxy_pass http://localhost:4000/spaces/;
}
# location /${BUCKET_NAME}/ {
# proxy_pass http://plane-minio:9000/uploads/;
# }
# location /api/ {
# proxy_pass http://api:8000/api/;
# }
# location /auth/ {
# proxy_pass http://api:8000/auth/;
# }
}
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate ./local.plane.tools.pem;
ssl_certificate_key ./local.plane.tools-key.pem;
server_name local.plane.tools;
#client_max_body_size ${FILE_SIZE_LIMIT};
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Permissions-Policy "interest-cohort=()" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Forwarded-Proto "$scheme";
add_header Host "$host";
location / {
proxy_pass http://localhost:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /god-mode/ {
proxy_pass http://localhost:3333/god-mode/;
}
location /spaces/ {
rewrite ^/spaces/?$ /spaces/login break;
proxy_pass http://localhost:4000/spaces/;
}
# location /${BUCKET_NAME}/ {
# proxy_pass http://plane-minio:9000/uploads/;
# }
# location /api/ {
# proxy_pass http://api:8000/api/;
# }
# location /auth/ {
# proxy_pass http://api:8000/auth/;
# }
}
}

View File

@ -17,6 +17,7 @@
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev --concurrency=13",
"nginx-local": "nginx -c nginx/local.conf -p .",
"start": "turbo run start",
"lint": "turbo run lint",
"clean": "turbo run clean",
@ -35,4 +36,4 @@
"@types/react": "18.2.48"
},
"packageManager": "yarn@1.22.19"
}
}