1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 08:10:07 +01:00

♻️ Refactoring secure proxy stub. Fixing SiteTest.

This commit is contained in:
Mikaël Popowicz
2021-04-23 22:18:14 +02:00
parent 3098f5ff0a
commit bfe95c26dd
2 changed files with 38 additions and 1 deletions

View File

@@ -2,12 +2,14 @@
server {
listen 127.0.0.1:80;
#listen VALET_LOOPBACK:80; # valet loopback
server_name VALET_SITE www.VALET_SITE *.VALET_SITE;
return 301 https://$host$request_uri;
}
server {
listen 127.0.0.1:443 ssl http2;
#listen VALET_LOOPBACK:443 ssl http2; # valet loopback
server_name VALET_SITE www.VALET_SITE *.VALET_SITE;
root /;
charset utf-8;
@@ -53,3 +55,38 @@ server {
deny all;
}
}
server {
listen 127.0.0.1:60;
#listen VALET_LOOPBACK:60; # valet loopback
server_name VALET_SITE www.VALET_SITE *.VALET_SITE;
root /;
charset utf-8;
client_max_body_size 128M;
add_header X-Robots-Tag 'noindex, nofollow, nosnippet, noarchive';
location /VALET_STATIC_PREFIX/ {
internal;
alias /;
try_files $uri $uri/;
}
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;
}
location ~ /\.ht {
deny all;
}
}

View File

@@ -373,7 +373,7 @@ public function test_add_non_secure_proxy()
{
$config = Mockery::mock(Configuration::class);
$config->shouldReceive('read')
->andReturn(['tld' => 'test']);
->andReturn(['tld' => 'test', 'loopback' => VALET_LOOPBACK]);
swap(Configuration::class, $config);