Skip to content

Instantly share code, notes, and snippets.

View coolsam726's full-sized avatar

Sam Maosa coolsam726

View GitHub Profile
@saineshmamgain
saineshmamgain / app.js
Created May 5, 2020 04:06
Setting up laravel-websockets on production server using nginx proxy with letsencrypt ssl
window.Echo = new Echo({
broadcaster: 'pusher',
key: process.env.MIX_PUSHER_APP_KEY,
wsHost: window.location.host,
wsPort: 80,
wssPort: 443,
disableStats: true,
enabledTransports: ['ws', 'wss'],
cluster: process.env.MIX_PUSHER_APP_CLUSTER,
});
@mreschke
mreschke / nginx.conf
Last active May 14, 2024 14:54
Nginx config for multiple laravel sites based on /api/v1 url paths
# This config will host your main [Laravel] GUI application at /, and any additional [Lumen] webservices at /api/v1 and /api/v2...
# This also works perfectly for all static file content in all projects
# This is full of debug comments so you can see how to print debug output to browser! Took me hours to nail this perfect config.
# Example:
# http://example.com - Main Laravel site as usual
# http://example.com/about - Main Laravel site about page as usual
# http://example.com/robots.txt - Main Laravel site static content as usual
# http://example.com/api/v1 - Lumen v1 api default / route
# http://example.com/api/v1/ - Lumen v1 api default / route