Skip to content

Instantly share code, notes, and snippets.

@manhg
Last active May 11, 2023 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manhg/6a693bb8c19921373093b0fdf6303290 to your computer and use it in GitHub Desktop.
Save manhg/6a693bb8c19921373093b0fdf6303290 to your computer and use it in GitHub Desktop.
proxy_read_timeout 600;
proxy_connect_timeout 600;
proxy_send_timeout 600;
server {
listen 80;
server_name
"~^(?P<app_name>[\w+\-]+)-(?P<app_port>\d{4})\.local$"
"~^(?P<app_name>[\w+\-]+)-(?P<app_port>\d{4})\.dev\.local$";
root /Volumes/Work/$app_name/public;
expires -1;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
etag off;
listen 443 ssl;
ssl_certificate /Volumes/Work/local/localhost+4.pem;
ssl_certificate_key /Volumes/Work/local/localhost+4-key.pem;
client_max_body_size 100m;
location / {
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_pass http://127.0.0.1:$app_port;
proxy_redirect http://127.0.0.1:$app_port /;
proxy_redirect http://localhost:$app_port /;
proxy_redirect http://$host:$app_port /;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment