Browse Source

update install instructions

main
ghost 12 months ago
parent
commit
482ce9491b
  1. 22
      nginx/texty.org.ua/yggbro/texty.org.ua/README.md
  2. 26
      nginx/texty.org.ua/yggbro/texty.org.ua/locations.conf
  3. 28
      nginx/texty.org.ua/yggbro/texty.org.ua/server.conf

22
nginx/texty.org.ua/yggbro/texty.org.ua/README.md

@ -6,12 +6,34 @@ Current implementation drops all JS and forward links to following locations: @@ -6,12 +6,34 @@ Current implementation drops all JS and forward links to following locations:
## Install
This is subfolder configuration, use `server.conf` preset only when `default_server` not defined in your system:
* `ln -s /etc/yggbro/nginx/texty.org.ua/yggbro/texty.org.ua/server.conf /etc/nginx/sites-enabled/yggbro.texty.org.ua.yggbro.texty.org.ua.conf`
Alternatively, add following line to existing `default_server`:
```
include /etc/yggbro/nginx/texty.org.ua/yggbro/texty.org.ua/locations.conf;
```
Test configuration and apply changes
* `nginx -t`
* `service nginx reload`
## Uninstall
Remove symlink if exists:
* `rm /etc/nginx/sites-enabled/yggbro.texty.org.ua.yggbro.texty.org.ua.conf`
Remove following line from existing `default_server`:
```
include /etc/yggbro/nginx/texty.org.ua/yggbro/texty.org.ua/locations.conf;
```
Test configuration and apply changes
* `nginx -t`
* `service nginx reload`

26
nginx/texty.org.ua/yggbro/texty.org.ua/locations.conf

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
location /yggbro/texty.org.ua {
# Forward to server
proxy_pass https://texty.org.ua/;
# 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://texty.org.ua' 'http://[$server_addr]/yggbro/texty.org.ua';
sub_filter 'https://texty.org.ua' 'http://[$server_addr]/yggbro/texty.org.ua';
sub_filter '<script' '<!-- <script';
sub_filter '</script>' '</script> -->';
sub_filter 'href="/support/"' 'href="https://texty.org.ua/p/support"';
sub_filter 'href="/' 'href="http://[$server_addr]/yggbro/texty.org.ua/';
sub_filter 'src="/' 'src="http://[$server_addr]/yggbro/texty.org.ua/';
sub_filter 'data-src="/' 'src="http://[$server_addr]/yggbro/texty.org.ua/';
sub_filter "url('/" "url('http://[$server_addr]/yggbro/texty.org.ua/";
# Feedback link to project repository
sub_filter '</body>' '<a style="position:fixed;top:20px;right:20px;z-index:999" href="https://github.com/YGGverse/YGGbro/tree/main/nginx/texty.org.ua/yggbro/texty.org.ua" target="_blank">YGGbro</a></body>';
}

28
nginx/texty.org.ua/yggbro/texty.org.ua/server.conf

@ -10,30 +10,6 @@ server { @@ -10,30 +10,6 @@ server {
# Listen defaults
server_name _;
location /yggbro/texty.org.ua {
# Forward to server
proxy_pass https://texty.org.ua/;
# 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://texty.org.ua' 'http://[$server_addr]/yggbro/texty.org.ua';
sub_filter 'https://texty.org.ua' 'http://[$server_addr]/yggbro/texty.org.ua';
sub_filter '<script' '<!-- <script';
sub_filter '</script>' '</script> -->';
sub_filter 'href="/support/"' 'href="https://texty.org.ua/p/support"';
sub_filter 'href="/' 'href="http://[$server_addr]/yggbro/texty.org.ua/';
sub_filter 'src="/' 'src="http://[$server_addr]/yggbro/texty.org.ua/';
sub_filter 'data-src="/' 'src="http://[$server_addr]/yggbro/texty.org.ua/';
sub_filter "url('/" "url('http://[$server_addr]/yggbro/texty.org.ua/";
# Feedback link to project repository
sub_filter '</body>' '<a style="position:fixed;top:20px;right:20px;z-index:999" href="https://github.com/YGGverse/YGGbro/tree/main/nginx/texty.org.ua/yggbro/texty.org.ua" target="_blank">YGGbro</a></body>';
}
# Include available locations
include /etc/yggbro/nginx/texty.org.ua/yggbro/texty.org.ua/locations.conf;
}

Loading…
Cancel
Save