Skip to content

Instantly share code, notes, and snippets.

@asifulmamun
Created August 14, 2025 12:54
Show Gist options
  • Save asifulmamun/8a647a9d9077a1355466a24da34cb6f6 to your computer and use it in GitHub Desktop.
Save asifulmamun/8a647a9d9077a1355466a24da34cb6f6 to your computer and use it in GitHub Desktop.
Locally 5000 port on, public port off, proxy server bypass the port, cloudflare free origin certficate, cloudlare full strict mode with dns proxy enabled
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name bazaarbound.com www.bazaarbound.com;
ssl_certificate /etc/ssl/cloudflare/cert.pem;
ssl_certificate_key /etc/ssl/cloudflare/key.pem;
root /var/www/html/bazaarbound-frontend/dist;
index index.php index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ /index.html;
}
# Backend API proxy (PM2 app running on port 5000)
location /api/ {
proxy_pass http://127.0.0.1:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
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;
}
}
@asifulmamun
Copy link
Author

Locally 5000 port on
public port off

proxy server bypass the port by nginx

cloudflare free SSL -> origin certficate issued by cert.pem and key.pem
cloudlare full strict mode of SSL
DNS A record proxy enabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment