forked from damsfx/valet-windows
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completed TODO: Add --secure option to
proxy
command inline with th…
…e Mac version - Added `--secure` option to `proxy` command. (by mikaelpopowicz in laravel#1005) - Updated the proxy stub to be the unsecure proxy stub as default. - Added new `secure.proxy.valet.conf` stub for the secure proxy. - Changed the `proxyCreate` to accommodate. - Changed `resecureForNewTld` to check for the new `secure.proxy` stub to ensure it keeps it secured when reinstalling Valet. (by ashleyshenton in laravel#1305) - Added support for proxying multiple sites at once by separating them with commas, in both `proxy` and `unproxy` commands. (by RobertBoes in laravel#1437) - Removed the obsolete `domain` alias for `tld` command. - Updated docs.
- Loading branch information
Showing
5 changed files
with
146 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# valet stub: secure.proxy.valet.conf | ||
|
||
server { | ||
listen 127.0.0.1:80; | ||
server_name VALET_SITE www.VALET_SITE *.VALET_SITE; | ||
return 301 https://$host$request_uri; | ||
} | ||
|
||
server { | ||
listen 127.0.0.1:443 ssl http2; | ||
server_name VALET_SITE www.VALET_SITE *.VALET_SITE; | ||
root /; | ||
charset utf-8; | ||
client_max_body_size 128M; | ||
http2_push_preload on; | ||
|
||
location /VALET_STATIC_PREFIX/ { | ||
internal; | ||
alias /; | ||
try_files $uri $uri/; | ||
} | ||
|
||
ssl_certificate "VALET_CERT"; | ||
ssl_certificate_key "VALET_KEY"; | ||
|
||
access_log off; | ||
error_log "VALET_HOME_PATH/Log/VALET_SITE-error.log"; | ||
|
||
error_page 404 "VALET_SERVER_PATH"; | ||
|
||
location / { | ||
proxy_pass VALET_PROXY_HOST; | ||
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; | ||
proxy_set_header X-Client-Verify SUCCESS; | ||
proxy_set_header X-Client-DN $ssl_client_s_dn; | ||
proxy_set_header X-SSL-Subject $ssl_client_s_dn; | ||
proxy_set_header X-SSL-Issuer $ssl_client_i_dn; | ||
proxy_set_header X-NginX-Proxy true; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
proxy_http_version 1.1; | ||
proxy_read_timeout 1800; | ||
proxy_connect_timeout 1800; | ||
chunked_transfer_encoding on; | ||
proxy_redirect off; | ||
proxy_buffering off; | ||
|
||
# Prevent being cached... | ||
# Code from https://ubiq.co/tech-blog/disable-nginx-cache/ | ||
|
||
# Kill cache | ||
add_header Last-Modified $date_gmt; | ||
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; | ||
if_modified_since off; | ||
expires off; | ||
etag off; | ||
# Don't cache it | ||
proxy_no_cache 1; | ||
# Even if cached, don't try to use it | ||
proxy_cache_bypass 1; | ||
} | ||
|
||
location ~ /\.ht { | ||
deny all; | ||
} | ||
} |
This file contains 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