-
-
Save pmgarman/8fba357c97193633a66d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Apache .htaccess | |
RedirectMatch 301 ^/wp-content/uploads/(.*) http://livewebsite.com/wp-content/uploads/$1 | |
# Nginx | |
location ~ ^/wp-content/uploads/(.*) { | |
rewrite ^/wp-content/uploads/(.*)$ http://livewebsite.com/wp-content/uploads/$1 redirect; | |
} |
Using Browsersync with Valet and Nginx
In order to use Browsersync with Valet & Nginx you will need to add proxy_*
settings to your root location block. There should already be a rewrite ^
there pointing to server.php
. The Proxy settings will go underneath the rewrite
setting. Like so:
location / {
rewrite ^ /home/username/.config/composer/vendor/valeryan/valet-wsl/server.php last;
proxy_pass https://localhost:3000;
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-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_read_timeout 1800;
proxy_connect_timeout 1800;
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nginx Notes
Nginx tries to apply blocks from the top to the bottom, therefore this needs to go at the top of the server block directly underneath: