Skip to content

Instantly share code, notes, and snippets.

@adrianmejias
Created August 6, 2024 16:54
Show Gist options
  • Save adrianmejias/aed20d6e5cd3c86a7d92b2be4dfb1c92 to your computer and use it in GitHub Desktop.
Save adrianmejias/aed20d6e5cd3c86a7d92b2be4dfb1c92 to your computer and use it in GitHub Desktop.
Local SSL Reverb for Laravel Herd

Instructions

  1. Create a blank site in Laravel Herd and enable SSL.
  2. Add reverb.laravel.test to the /Users/<username>/Library/Application Support/Herd/valet/Nginx/ directory.
  3. Copy the contents of reverb.laravel.test file below and update <username> with yours.
  4. Reload nginx via Laravel Herd.
  5. Update your .env -> REVERB_HOST and REVERB_PORT like the values below.
REVERB_APP_ID=1001
REVERB_APP_KEY=laravel-herd
REVERB_APP_SECRET=secret
REVERB_HOST="reverb.laravel.test"
REVERB_PORT=443
REVERB_SCHEME=https
server {
listen 127.0.0.1:80;
#listen 127.0.0.1:80; # valet loopback
server_name reverb.laravel.test;
root /;
charset utf-8;
client_max_body_size 512M;
http2 on;
location / {
proxy_pass http://localhost:8080;
proxy_read_timeout 60;
proxy_connect_timeout 60;
proxy_redirect off;
proxy_cache_bypass $http_upgrade;
proxy_http_version 1.1;
proxy_ssl_session_reuse off;
proxy_intercept_errors on;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Client-Verify true;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header Host $host;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log "/Users/<username>/Library/Application Support/Herd/Log/nginx-error.log";
}
server {
listen 127.0.0.1:443 ssl;
#listen VALET_LOOPBACK:443 ssl; # valet loopback
server_name reverb.laravel.test;
root /;
charset utf-8;
client_max_body_size 512M;
http2 on;
ssl_certificate "/Users/<username>/Library/Application Support/Herd/config/valet/Certificates/laravel.test.crt";
ssl_certificate_key "/Users/<username>/Library/Application Support/Herd/config/valet/Certificates/laravel.test.key";
location / {
proxy_pass http://localhost:8080;
proxy_read_timeout 60;
proxy_connect_timeout 60;
proxy_redirect off;
proxy_cache_bypass $http_upgrade;
proxy_http_version 1.1;
proxy_ssl_session_reuse off;
proxy_intercept_errors on;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Client-Verify true;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header Host $host;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log "/Users/<username>/Library/Application Support/Herd/Log/nginx-error.log";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment