mirror of
https://github.com/YGGverse/YGGbro.git
synced 2025-02-07 04:24:25 +00:00
update install instructions
This commit is contained in:
parent
7df6e09da4
commit
482ce9491b
@ -6,12 +6,34 @@ Current implementation drops all JS and forward links to following locations:
|
|||||||
|
|
||||||
## Install
|
## 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`
|
* `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`
|
* `nginx -t`
|
||||||
* `service nginx reload`
|
* `service nginx reload`
|
||||||
|
|
||||||
## Uninstall
|
## Uninstall
|
||||||
|
|
||||||
|
Remove symlink if exists:
|
||||||
|
|
||||||
* `rm /etc/nginx/sites-enabled/yggbro.texty.org.ua.yggbro.texty.org.ua.conf`
|
* `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`
|
* `nginx -t`
|
||||||
* `service nginx reload`
|
* `service nginx reload`
|
26
nginx/texty.org.ua/yggbro/texty.org.ua/locations.conf
Normal file
26
nginx/texty.org.ua/yggbro/texty.org.ua/locations.conf
Normal file
@ -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>';
|
||||||
|
}
|
@ -10,30 +10,6 @@ server {
|
|||||||
# Listen defaults
|
# Listen defaults
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
location /yggbro/texty.org.ua {
|
# Include available locations
|
||||||
|
include /etc/yggbro/nginx/texty.org.ua/yggbro/texty.org.ua/locations.conf;
|
||||||
# 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>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user