diff --git a/README.md b/README.md index 535d2cb..f0d44fd 100644 --- a/README.md +++ b/README.md @@ -65,4 +65,10 @@ _*YGGbro project provides free namespace `.bro.ygg` for Yggdrasil proxy instance * [texty.org.ua](https://texty.org.ua/) | [nginx](https://github.com/YGGverse/YGGbro/tree/main/nginx/texty.org.ua) + `http://[201:5eb5:f061:678e:7565:6338:c02c:5251]/yggbro/texty.org.ua/` | [nginx](https://github.com/YGGverse/YGGbro/tree/main/nginx/texty.org.ua/yggbro/texty.org.ua) - + `http://texty.org.ua.bro.ygg` | [nginx](https://github.com/YGGverse/YGGbro/tree/main/nginx/texty.org.ua/texty.org.ua.bro.ygg) \ No newline at end of file + + `http://texty.org.ua.bro.ygg` | [nginx](https://github.com/YGGverse/YGGbro/tree/main/nginx/texty.org.ua/texty.org.ua.bro.ygg) + +#### Documentary + +* [mentallandscape.com](http://mentallandscape.com/) | [nginx](https://github.com/YGGverse/YGGbro/tree/main/nginx/mentallandscape.com) + + `http://[201:5eb5:f061:678e:7565:6338:c02c:5251]/yggbro/mentallandscape.com/` | [nginx](https://github.com/YGGverse/YGGbro/tree/main/nginx/mentallandscape.com/yggbro/mentallandscape.com) + + `http://mentallandscape.com.bro.ygg` | [nginx](https://github.com/YGGverse/YGGbro/tree/main/nginx/mentallandscape.com/mentallandscape.com.bro.ygg) \ No newline at end of file diff --git a/nginx/mentallandscape.com/mentallandscape.com.bro.ygg/README.md b/nginx/mentallandscape.com/mentallandscape.com.bro.ygg/README.md new file mode 100644 index 0000000..cd1dbd3 --- /dev/null +++ b/nginx/mentallandscape.com/mentallandscape.com.bro.ygg/README.md @@ -0,0 +1,17 @@ +# Nginx proxy configuration for mentallandscape.com.bro.ygg + +Current implementation drops all JS and forward links to following locations: + +* `mentallandscape.com` > `mentallandscape.com.bro.ygg` + +## Install + +* `ln -s /etc/yggbro/nginx/mentallandscape.com/mentallandscape.com.bro.ygg/server.conf /etc/nginx/sites-enabled/yggbro.mentallandscape.com.mentallandscape.com.bro.ygg.conf` +* `nginx -t` +* `service nginx reload` + +## Uninstall + +* `rm /etc/nginx/sites-enabled/yggbro.mentallandscape.com.mentallandscape.com.bro.ygg.conf` +* `nginx -t` +* `service nginx reload` \ No newline at end of file diff --git a/nginx/mentallandscape.com/mentallandscape.com.bro.ygg/server.conf b/nginx/mentallandscape.com/mentallandscape.com.bro.ygg/server.conf new file mode 100644 index 0000000..874f6f4 --- /dev/null +++ b/nginx/mentallandscape.com/mentallandscape.com.bro.ygg/server.conf @@ -0,0 +1,38 @@ +server { + + # HTTP/IPv6 only + listen [::]:80; + + # Yggdrasil only + allow 0200::/7; + deny all; + + server_name mentallandscape.com.bro.ygg; + + location / { + + # Forward to server + proxy_pass http://mentallandscape.com/; + + # Tell to server, that's proxy request + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + + # Replace links + sub_filter_once off; + sub_filter_types *; + + sub_filter 'http://mentallandscape.com' 'http://mentallandscape.com.bro.ygg'; + sub_filter 'https://mentallandscape.com' 'http://mentallandscape.com.bro.ygg'; + sub_filter '' ' -->'; + sub_filter 'href="/support/"' 'href="https://mentallandscape.com/p/support"'; + sub_filter 'href="/' 'href="http://mentallandscape.com.bro.ygg/'; + sub_filter 'src="/' 'src="http://mentallandscape.com.bro.ygg/'; + sub_filter 'data-src="/' 'src="http://mentallandscape.com.bro.ygg/'; + sub_filter "url('/" "url('http://mentallandscape.com.bro.ygg/"; + + # Feedback link to project repository + sub_filter '' 'YGGbro'; + } +} diff --git a/nginx/mentallandscape.com/yggbro/mentallandscape.com/README.md b/nginx/mentallandscape.com/yggbro/mentallandscape.com/README.md new file mode 100644 index 0000000..3dc066b --- /dev/null +++ b/nginx/mentallandscape.com/yggbro/mentallandscape.com/README.md @@ -0,0 +1,39 @@ +# Nginx proxy configuration for /yggbro/mentallandscape.com subfolder location + +Current implementation drops all JS and forward links to following locations: + +* `mentallandscape.com` > `/yggbro/mentallandscape.com` + +## Install + +This is subfolder configuration, use `server.conf` preset only when `default_server` not defined in your system: + +* `ln -s /etc/yggbro/nginx/mentallandscape.com/yggbro/mentallandscape.com/server.conf /etc/nginx/sites-enabled/yggbro.mentallandscape.com.yggbro.mentallandscape.com.conf` + +Alternatively, add following line to existing `default_server`: + +``` +include /etc/yggbro/nginx/mentallandscape.com/yggbro/mentallandscape.com/location.conf; +``` + +Test configuration and apply changes + +* `nginx -t` +* `service nginx reload` + +## Uninstall + +Remove symlink if exists: + +* `rm /etc/nginx/sites-enabled/yggbro.mentallandscape.com.yggbro.mentallandscape.com.conf` + +Remove following line from existing `default_server`: + +``` +include /etc/yggbro/nginx/mentallandscape.com/yggbro/mentallandscape.com/location.conf; +``` + +Test configuration and apply changes + +* `nginx -t` +* `service nginx reload` \ No newline at end of file diff --git a/nginx/mentallandscape.com/yggbro/mentallandscape.com/location.conf b/nginx/mentallandscape.com/yggbro/mentallandscape.com/location.conf new file mode 100644 index 0000000..dd0b543 --- /dev/null +++ b/nginx/mentallandscape.com/yggbro/mentallandscape.com/location.conf @@ -0,0 +1,26 @@ +location /yggbro/mentallandscape.com { + + # Forward to server + proxy_pass http://mentallandscape.com/; + + # Tell to server, that's proxy request + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + + # Replace links + sub_filter_once off; + sub_filter_types *; + + sub_filter 'http://mentallandscape.com' 'http://[$server_addr]/yggbro/mentallandscape.com'; + sub_filter 'https://mentallandscape.com' 'http://[$server_addr]/yggbro/mentallandscape.com'; + sub_filter '' ' -->'; + sub_filter 'href="/support/"' 'href="https://mentallandscape.com/p/support"'; + sub_filter 'href="/' 'href="http://[$server_addr]/yggbro/mentallandscape.com/'; + sub_filter 'src="/' 'src="http://[$server_addr]/yggbro/mentallandscape.com/'; + sub_filter 'data-src="/' 'src="http://[$server_addr]/yggbro/mentallandscape.com/'; + sub_filter "url('/" "url('http://[$server_addr]/yggbro/mentallandscape.com/"; + + # Feedback link to project repository + sub_filter '' 'YGGbro'; +} \ No newline at end of file diff --git a/nginx/mentallandscape.com/yggbro/mentallandscape.com/server.conf b/nginx/mentallandscape.com/yggbro/mentallandscape.com/server.conf new file mode 100644 index 0000000..e7e4df1 --- /dev/null +++ b/nginx/mentallandscape.com/yggbro/mentallandscape.com/server.conf @@ -0,0 +1,15 @@ +server { + + # HTTP/IPv6 connections only + listen [::]:80 default_server; # make sure default_server not exists or throw an exception + + # Yggdrasil connections only + allow 0200::/7; + deny all; + + # Listen defaults + server_name _; + + # Include available locations + include /etc/yggbro/nginx/mentallandscape.com/yggbro/mentallandscape.com/location.conf; +}