Skip to content

Instantly share code, notes, and snippets.

@laocoi
Last active June 8, 2024 06:42
Show Gist options
  • Save laocoi/f9fdf5df289baf748c196f5b6d6e6272 to your computer and use it in GitHub Desktop.
Save laocoi/f9fdf5df289baf748c196f5b6d6e6272 to your computer and use it in GitHub Desktop.
Wrangler + SSL + Nginx | Xampp

Wrangler + SSL + Nginx | Xampp

Nginx config

server {
    listen 443 ssl;
    server_name yourdomain.com;

    ssl_certificate /path/to/cert.crt;
    ssl_certificate_key /path/to/key.key;

    location / {
        proxy_pass http://localhost:8787;
        proxy_set_header Host $host;
        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;
    }
}

Xampp Config

<VirtualHost 127.0.0.1:443>     
    ServerName  yourdomain.com
    SSLEngine on
    SSLCertificateFile "/path/to/cert.crt";
    SSLCertificateKeyFile "/path/to/key.key"
    ProxyRequests On
    <Proxy>
        Order deny,allow
        Allow from all
    </Proxy>
    ProxyPass / http://localhost:8787/
    Header set Access-Control-Allow-Origin "*"    
 </VirtualHost>

Restart the server and start wrangler on the port that you want wrangler dev --port 8787

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