mirror of
https://github.com/YGGverse/YGGbro.git
synced 2025-01-29 16:14:27 +00:00
add more opennet subdomains support, update readme
This commit is contained in:
parent
06cf59c43c
commit
df1484c8ad
@ -0,0 +1,29 @@
|
|||||||
|
# Nginx proxy configuration for OpenNet
|
||||||
|
|
||||||
|
Current implementation forward subdomains to following proxy locations:
|
||||||
|
|
||||||
|
* `opennet.ru` > `/opennet`
|
||||||
|
* `www.opennet.ru` > `/opennet/www`
|
||||||
|
* `bsd.opennet.ru` > `/opennet/bsd`
|
||||||
|
* `cisco.opennet.ru` > `/opennet/cisco`
|
||||||
|
* `grab.opennet.ru` > `/opennet/grab`
|
||||||
|
* `linux.opennet.ru` > `/opennet/linux`
|
||||||
|
* `m.opennet.ru` > `/opennet/m`
|
||||||
|
* `mobile.opennet.ru` > `/opennet/mobile`
|
||||||
|
* `palm.opennet.ru` > `/opennet/palm`
|
||||||
|
* `security.opennet.ru` > `/opennet/security`
|
||||||
|
* `solaris.opennet.ru` > `/opennet/solaris`
|
||||||
|
* `web.opennet.ru` > `/opennet/web`
|
||||||
|
* `wiki.opennet.ru` > `/opennet/wiki`
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. Download `nginx/opennet` to `/etc/nginx` folder
|
||||||
|
2. Copy `nginx/opennet/server.conf` to `sites-available/opennet.conf`
|
||||||
|
3. Alternatively, include `nginx/opennet/locations.conf` to existing website config at `sites-available` then reload nginx configuration
|
||||||
|
|
||||||
|
## Issues
|
||||||
|
|
||||||
|
1. At this moment, config drops all JS some tabs could not work
|
||||||
|
2. Youtube embedded content still works
|
||||||
|
3. Redirect cases not implemented yet and require additional rules implementation
|
14
nginx/opennet/include/locations/bsd.conf
Normal file
14
nginx/opennet/include/locations/bsd.conf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
location /opennet/bsd {
|
||||||
|
|
||||||
|
# Domain source
|
||||||
|
proxy_pass https://bsd.opennet.ru/;
|
||||||
|
|
||||||
|
# Include common rules
|
||||||
|
include /etc/nginx/opennet/include/locations/include/common.conf;
|
||||||
|
|
||||||
|
# Relative paths
|
||||||
|
sub_filter 'href="/' 'href="http://[$server_addr]/opennet/bsd/';
|
||||||
|
sub_filter 'src="/' 'src="http://[$server_addr]/opennet/bsd/';
|
||||||
|
sub_filter 'data-src="/' 'src="http://[$server_addr]/opennet/bsd/';
|
||||||
|
sub_filter "url('/" "url('http://[$server_addr]/opennet/bsd/";
|
||||||
|
}
|
14
nginx/opennet/include/locations/cisco.conf
Normal file
14
nginx/opennet/include/locations/cisco.conf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
location /opennet/cisco {
|
||||||
|
|
||||||
|
# Domain source
|
||||||
|
proxy_pass https://cisco.opennet.ru/;
|
||||||
|
|
||||||
|
# Include common rules
|
||||||
|
include /etc/nginx/opennet/include/locations/include/common.conf;
|
||||||
|
|
||||||
|
# Relative paths
|
||||||
|
sub_filter 'href="/' 'href="http://[$server_addr]/opennet/cisco/';
|
||||||
|
sub_filter 'src="/' 'src="http://[$server_addr]/opennet/cisco/';
|
||||||
|
sub_filter 'data-src="/' 'src="http://[$server_addr]/opennet/cisco/';
|
||||||
|
sub_filter "url('/" "url('http://[$server_addr]/opennet/cisco/";
|
||||||
|
}
|
14
nginx/opennet/include/locations/grab.conf
Normal file
14
nginx/opennet/include/locations/grab.conf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
location /opennet/grab {
|
||||||
|
|
||||||
|
# Domain source
|
||||||
|
proxy_pass https://grab.opennet.ru/;
|
||||||
|
|
||||||
|
# Include common rules
|
||||||
|
include /etc/nginx/opennet/include/locations/include/common.conf;
|
||||||
|
|
||||||
|
# Relative paths
|
||||||
|
sub_filter 'href="/' 'href="http://[$server_addr]/opennet/grab/';
|
||||||
|
sub_filter 'src="/' 'src="http://[$server_addr]/opennet/grab/';
|
||||||
|
sub_filter 'data-src="/' 'src="http://[$server_addr]/opennet/grab/';
|
||||||
|
sub_filter "url('/" "url('http://[$server_addr]/opennet/grab/";
|
||||||
|
}
|
@ -1,3 +1,7 @@
|
|||||||
|
# Include configuration file
|
||||||
|
# Describes common rules for available locations at
|
||||||
|
# nginx/opennet/include/locations
|
||||||
|
|
||||||
# Tell to server, that's proxy request
|
# Tell to server, that's proxy request
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
14
nginx/opennet/include/locations/linux.conf
Normal file
14
nginx/opennet/include/locations/linux.conf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
location /opennet/linux {
|
||||||
|
|
||||||
|
# Domain source
|
||||||
|
proxy_pass https://linux.opennet.ru/;
|
||||||
|
|
||||||
|
# Include common rules
|
||||||
|
include /etc/nginx/opennet/include/locations/include/common.conf;
|
||||||
|
|
||||||
|
# Relative paths
|
||||||
|
sub_filter 'href="/' 'href="http://[$server_addr]/opennet/linux/';
|
||||||
|
sub_filter 'src="/' 'src="http://[$server_addr]/opennet/linux/';
|
||||||
|
sub_filter 'data-src="/' 'src="http://[$server_addr]/opennet/linux/';
|
||||||
|
sub_filter "url('/" "url('http://[$server_addr]/opennet/linux/";
|
||||||
|
}
|
14
nginx/opennet/include/locations/m.conf
Normal file
14
nginx/opennet/include/locations/m.conf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
location /opennet/m {
|
||||||
|
|
||||||
|
# Domain source
|
||||||
|
proxy_pass https://m.opennet.ru/;
|
||||||
|
|
||||||
|
# Include common rules
|
||||||
|
include /etc/nginx/opennet/include/locations/include/common.conf;
|
||||||
|
|
||||||
|
# Relative paths
|
||||||
|
sub_filter 'href="/' 'href="http://[$server_addr]/opennet/m/';
|
||||||
|
sub_filter 'src="/' 'src="http://[$server_addr]/opennet/m/';
|
||||||
|
sub_filter 'data-src="/' 'src="http://[$server_addr]/opennet/m/';
|
||||||
|
sub_filter "url('/" "url('http://[$server_addr]/opennet/m/";
|
||||||
|
}
|
14
nginx/opennet/include/locations/mobile.conf
Normal file
14
nginx/opennet/include/locations/mobile.conf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
location /opennet/mobile {
|
||||||
|
|
||||||
|
# Domain source
|
||||||
|
proxy_pass https://mobile.opennet.ru/;
|
||||||
|
|
||||||
|
# Include common rules
|
||||||
|
include /etc/nginx/opennet/include/locations/include/common.conf;
|
||||||
|
|
||||||
|
# Relative paths
|
||||||
|
sub_filter 'href="/' 'href="http://[$server_addr]/opennet/mobile/';
|
||||||
|
sub_filter 'src="/' 'src="http://[$server_addr]/opennet/mobile/';
|
||||||
|
sub_filter 'data-src="/' 'src="http://[$server_addr]/opennet/mobile/';
|
||||||
|
sub_filter "url('/" "url('http://[$server_addr]/opennet/mobile/";
|
||||||
|
}
|
14
nginx/opennet/include/locations/palm.conf
Normal file
14
nginx/opennet/include/locations/palm.conf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
location /opennet/palm {
|
||||||
|
|
||||||
|
# Domain source
|
||||||
|
proxy_pass https://palm.opennet.ru/;
|
||||||
|
|
||||||
|
# Include common rules
|
||||||
|
include /etc/nginx/opennet/include/locations/include/common.conf;
|
||||||
|
|
||||||
|
# Relative paths
|
||||||
|
sub_filter 'href="/' 'href="http://[$server_addr]/opennet/palm/';
|
||||||
|
sub_filter 'src="/' 'src="http://[$server_addr]/opennet/palm/';
|
||||||
|
sub_filter 'data-src="/' 'src="http://[$server_addr]/opennet/palm/';
|
||||||
|
sub_filter "url('/" "url('http://[$server_addr]/opennet/palm/";
|
||||||
|
}
|
14
nginx/opennet/include/locations/security.conf
Normal file
14
nginx/opennet/include/locations/security.conf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
location /opennet/security {
|
||||||
|
|
||||||
|
# Domain source
|
||||||
|
proxy_pass https://security.opennet.ru/;
|
||||||
|
|
||||||
|
# Include common rules
|
||||||
|
include /etc/nginx/opennet/include/locations/include/common.conf;
|
||||||
|
|
||||||
|
# Relative paths
|
||||||
|
sub_filter 'href="/' 'href="http://[$server_addr]/opennet/security/';
|
||||||
|
sub_filter 'src="/' 'src="http://[$server_addr]/opennet/security/';
|
||||||
|
sub_filter 'data-src="/' 'src="http://[$server_addr]/opennet/security/';
|
||||||
|
sub_filter "url('/" "url('http://[$server_addr]/opennet/security/";
|
||||||
|
}
|
14
nginx/opennet/include/locations/solaris.conf
Normal file
14
nginx/opennet/include/locations/solaris.conf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
location /opennet/solaris {
|
||||||
|
|
||||||
|
# Domain source
|
||||||
|
proxy_pass https://solaris.opennet.ru/;
|
||||||
|
|
||||||
|
# Include common rules
|
||||||
|
include /etc/nginx/opennet/include/locations/include/common.conf;
|
||||||
|
|
||||||
|
# Relative paths
|
||||||
|
sub_filter 'href="/' 'href="http://[$server_addr]/opennet/solaris/';
|
||||||
|
sub_filter 'src="/' 'src="http://[$server_addr]/opennet/solaris/';
|
||||||
|
sub_filter 'data-src="/' 'src="http://[$server_addr]/opennet/solaris/';
|
||||||
|
sub_filter "url('/" "url('http://[$server_addr]/opennet/solaris/";
|
||||||
|
}
|
14
nginx/opennet/include/locations/web.conf
Normal file
14
nginx/opennet/include/locations/web.conf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
location /opennet/web {
|
||||||
|
|
||||||
|
# Domain source
|
||||||
|
proxy_pass https://web.opennet.ru/;
|
||||||
|
|
||||||
|
# Include common rules
|
||||||
|
include /etc/nginx/opennet/include/locations/include/common.conf;
|
||||||
|
|
||||||
|
# Relative paths
|
||||||
|
sub_filter 'href="/' 'href="http://[$server_addr]/opennet/web/';
|
||||||
|
sub_filter 'src="/' 'src="http://[$server_addr]/opennet/web/';
|
||||||
|
sub_filter 'data-src="/' 'src="http://[$server_addr]/opennet/web/';
|
||||||
|
sub_filter "url('/" "url('http://[$server_addr]/opennet/web/";
|
||||||
|
}
|
@ -7,5 +7,6 @@ server {
|
|||||||
# allow 0200::/7;
|
# allow 0200::/7;
|
||||||
# deny all;
|
# deny all;
|
||||||
|
|
||||||
|
# Include available locations
|
||||||
include /etc/nginx/opennet/locations.conf;
|
include /etc/nginx/opennet/locations.conf;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user