Created
August 14, 2025 12:54
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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