mirror of
https://github.com/YGGverse/YGGbro.git
synced 2025-02-07 04:24:25 +00:00
refactor opennet conf
This commit is contained in:
parent
1872672f64
commit
b24b24a672
@ -1,4 +1,4 @@
|
|||||||
# Nginx proxy configuration for OpenNet
|
# Nginx proxy configuration for OpenNet located at subfolder
|
||||||
|
|
||||||
Current implementation forward subdomains to following proxy locations:
|
Current implementation forward subdomains to following proxy locations:
|
||||||
|
|
||||||
@ -17,11 +17,17 @@ Current implementation forward subdomains to following proxy locations:
|
|||||||
* `wiki.opennet.ru` > `/opennet/wiki`
|
* `wiki.opennet.ru` > `/opennet/wiki`
|
||||||
* `forum.opennet.ru` > `/opennet/wwwcgi-bin/openforum/vsluhboard.cgi`
|
* `forum.opennet.ru` > `/opennet/wwwcgi-bin/openforum/vsluhboard.cgi`
|
||||||
|
|
||||||
## Installation
|
## Install
|
||||||
|
|
||||||
1. Download `nginx/opennet` content to `/etc/nginx/opennet` folder
|
* `ln -s /etc/yggbro/nginx/opennet/server.conf /etc/nginx/sites-enabled/yggbro.opennet.conf`
|
||||||
2. Copy `nginx/opennet/server.conf` to `/etc/nginx/sites-available/opennet.conf` then change commented options for your needs
|
* `nginx -t`
|
||||||
3. Alternatively, include `nginx/opennet/locations.conf` to existing website config at `sites-available` then reload nginx configuration
|
* `service nginx reload`
|
||||||
|
|
||||||
|
## Uninstall
|
||||||
|
|
||||||
|
* `rm /etc/nginx/sites-enabled/yggbro.opennet.conf`
|
||||||
|
* `nginx -t`
|
||||||
|
* `service nginx reload`
|
||||||
|
|
||||||
## Issues
|
## Issues
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Prevent out redirects (solution for issue #2)
|
# Prevent out redirects (solution for issue #2)
|
||||||
|
|
||||||
location @opennet_locations_handle_redirect {
|
location @yggbro_nginx_opennet_handles_redirect {
|
||||||
|
|
||||||
set $original_uri $uri;
|
set $original_uri $uri;
|
||||||
set $orig_loc $upstream_http_location;
|
set $orig_loc $upstream_http_location;
|
@ -1,41 +1,38 @@
|
|||||||
# www-less
|
# www-less
|
||||||
include /etc/nginx/opennet/locations/www-less.conf;
|
include /etc/yggbro/nginx/opennet/locations/www-less.conf;
|
||||||
|
|
||||||
# www
|
# www
|
||||||
include /etc/nginx/opennet/locations/www.conf;
|
include /etc/yggbro/nginx/opennet/locations/www.conf;
|
||||||
|
|
||||||
# bsd
|
# bsd
|
||||||
include /etc/nginx/opennet/locations/bsd.conf;
|
include /etc/yggbro/nginx/opennet/locations/bsd.conf;
|
||||||
|
|
||||||
# cisco
|
# cisco
|
||||||
include /etc/nginx/opennet/locations/cisco.conf;
|
include /etc/yggbro/nginx/opennet/locations/cisco.conf;
|
||||||
|
|
||||||
# grab
|
# grab
|
||||||
include /etc/nginx/opennet/locations/grab.conf;
|
include /etc/yggbro/nginx/opennet/locations/grab.conf;
|
||||||
|
|
||||||
# linux
|
# linux
|
||||||
include /etc/nginx/opennet/locations/linux.conf;
|
include /etc/yggbro/nginx/opennet/locations/linux.conf;
|
||||||
|
|
||||||
# m
|
# m
|
||||||
include /etc/nginx/opennet/locations/m.conf;
|
include /etc/yggbro/nginx/opennet/locations/m.conf;
|
||||||
|
|
||||||
# mobile
|
# mobile
|
||||||
include /etc/nginx/opennet/locations/mobile.conf;
|
include /etc/yggbro/nginx/opennet/locations/mobile.conf;
|
||||||
|
|
||||||
# palm
|
# palm
|
||||||
include /etc/nginx/opennet/locations/palm.conf;
|
include /etc/yggbro/nginx/opennet/locations/palm.conf;
|
||||||
|
|
||||||
# security
|
# security
|
||||||
include /etc/nginx/opennet/locations/security.conf;
|
include /etc/yggbro/nginx/opennet/locations/security.conf;
|
||||||
|
|
||||||
# solaris
|
# solaris
|
||||||
include /etc/nginx/opennet/locations/solaris.conf;
|
include /etc/yggbro/nginx/opennet/locations/solaris.conf;
|
||||||
|
|
||||||
# web
|
# web
|
||||||
include /etc/nginx/opennet/locations/web.conf;
|
include /etc/yggbro/nginx/opennet/locations/web.conf;
|
||||||
|
|
||||||
# wiki
|
# wiki
|
||||||
include /etc/nginx/opennet/locations/wiki.conf;
|
include /etc/yggbro/nginx/opennet/locations/wiki.conf;
|
||||||
|
|
||||||
# handles (do not delete)
|
|
||||||
include /etc/nginx/opennet/locations/handle/redirect.conf;
|
|
@ -4,7 +4,7 @@ location /opennet/bsd {
|
|||||||
proxy_pass https://bsd.opennet.ru/;
|
proxy_pass https://bsd.opennet.ru/;
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include /etc/nginx/opennet/locations/include/common.conf;
|
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
|
||||||
|
|
||||||
# Relative paths
|
# Relative paths
|
||||||
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/bsd/';
|
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/bsd/';
|
||||||
|
@ -4,7 +4,7 @@ location /opennet/cisco {
|
|||||||
proxy_pass https://cisco.opennet.ru/;
|
proxy_pass https://cisco.opennet.ru/;
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include /etc/nginx/opennet/locations/include/common.conf;
|
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
|
||||||
|
|
||||||
# Relative paths
|
# Relative paths
|
||||||
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/cisco/';
|
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/cisco/';
|
||||||
|
@ -4,7 +4,7 @@ location /opennet/grab {
|
|||||||
proxy_pass https://grab.opennet.ru/;
|
proxy_pass https://grab.opennet.ru/;
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include /etc/nginx/opennet/locations/include/common.conf;
|
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
|
||||||
|
|
||||||
# Relative paths
|
# Relative paths
|
||||||
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/grab/';
|
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/grab/';
|
||||||
|
@ -8,7 +8,7 @@ proxy_set_header X-Real-IP $remote_addr;
|
|||||||
|
|
||||||
# Prevent out redirects (issue #2)
|
# Prevent out redirects (issue #2)
|
||||||
proxy_intercept_errors on;
|
proxy_intercept_errors on;
|
||||||
error_page 301 302 307 = @opennet_locations_handle_redirect;
|
error_page 301 302 307 = @yggbro_nginx_opennet_handles_redirect;
|
||||||
|
|
||||||
# Replace all matches
|
# Replace all matches
|
||||||
sub_filter_once off;
|
sub_filter_once off;
|
||||||
|
@ -4,7 +4,7 @@ location /opennet/linux {
|
|||||||
proxy_pass https://linux.opennet.ru/;
|
proxy_pass https://linux.opennet.ru/;
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include /etc/nginx/opennet/locations/include/common.conf;
|
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
|
||||||
|
|
||||||
# Relative paths
|
# Relative paths
|
||||||
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/linux/';
|
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/linux/';
|
||||||
|
@ -4,7 +4,7 @@ location /opennet/m {
|
|||||||
proxy_pass https://m.opennet.ru/;
|
proxy_pass https://m.opennet.ru/;
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include /etc/nginx/opennet/locations/include/common.conf;
|
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
|
||||||
|
|
||||||
# Relative paths
|
# Relative paths
|
||||||
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/m/';
|
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/m/';
|
||||||
|
@ -4,7 +4,7 @@ location /opennet/mobile {
|
|||||||
proxy_pass https://mobile.opennet.ru/;
|
proxy_pass https://mobile.opennet.ru/;
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include /etc/nginx/opennet/locations/include/common.conf;
|
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
|
||||||
|
|
||||||
# Relative paths
|
# Relative paths
|
||||||
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/mobile/';
|
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/mobile/';
|
||||||
|
@ -4,7 +4,7 @@ location /opennet/palm {
|
|||||||
proxy_pass https://palm.opennet.ru/;
|
proxy_pass https://palm.opennet.ru/;
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include /etc/nginx/opennet/locations/include/common.conf;
|
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
|
||||||
|
|
||||||
# Relative paths
|
# Relative paths
|
||||||
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/palm/';
|
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/palm/';
|
||||||
|
@ -4,7 +4,7 @@ location /opennet/security {
|
|||||||
proxy_pass https://security.opennet.ru/;
|
proxy_pass https://security.opennet.ru/;
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include /etc/nginx/opennet/locations/include/common.conf;
|
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
|
||||||
|
|
||||||
# Relative paths
|
# Relative paths
|
||||||
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/security/';
|
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/security/';
|
||||||
|
@ -4,7 +4,7 @@ location /opennet/solaris {
|
|||||||
proxy_pass https://solaris.opennet.ru/;
|
proxy_pass https://solaris.opennet.ru/;
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include /etc/nginx/opennet/locations/include/common.conf;
|
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
|
||||||
|
|
||||||
# Relative paths
|
# Relative paths
|
||||||
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/solaris/';
|
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/solaris/';
|
||||||
|
@ -4,7 +4,7 @@ location /opennet/web {
|
|||||||
proxy_pass https://web.opennet.ru/;
|
proxy_pass https://web.opennet.ru/;
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include /etc/nginx/opennet/locations/include/common.conf;
|
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
|
||||||
|
|
||||||
# Relative paths
|
# Relative paths
|
||||||
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/web/';
|
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/web/';
|
||||||
|
@ -4,7 +4,7 @@ location /opennet/wiki {
|
|||||||
proxy_pass https://wiki.opennet.ru/;
|
proxy_pass https://wiki.opennet.ru/;
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include /etc/nginx/opennet/locations/include/common.conf;
|
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
|
||||||
|
|
||||||
# Relative paths
|
# Relative paths
|
||||||
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/wiki/';
|
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/wiki/';
|
||||||
|
@ -4,7 +4,7 @@ location /opennet {
|
|||||||
proxy_pass https://opennet.ru/;
|
proxy_pass https://opennet.ru/;
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include /etc/nginx/opennet/locations/include/common.conf;
|
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
|
||||||
|
|
||||||
# Relative paths
|
# Relative paths
|
||||||
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/opennet/';
|
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/opennet/';
|
||||||
|
@ -4,7 +4,7 @@ location /opennet/www {
|
|||||||
proxy_pass https://www.opennet.ru/;
|
proxy_pass https://www.opennet.ru/;
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include /etc/nginx/opennet/locations/include/common.conf;
|
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
|
||||||
|
|
||||||
# Relative paths
|
# Relative paths
|
||||||
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/www/';
|
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/www/';
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
server {
|
server {
|
||||||
|
|
||||||
# HTTP/IPv6 connections only
|
# HTTP/IPv6 connections only
|
||||||
# listen [::]:80 ipv6only=on _;
|
listen [::]:80;
|
||||||
|
|
||||||
# Yggdrasil connections only
|
# Yggdrasil connections only
|
||||||
# allow 0200::/7;
|
allow 0200::/7;
|
||||||
# deny all;
|
deny all;
|
||||||
|
|
||||||
|
# Include handles
|
||||||
|
include /etc/yggbro/nginx/opennet/handles/redirect.conf;
|
||||||
|
|
||||||
# Include available locations
|
# Include available locations
|
||||||
include /etc/nginx/opennet/locations.conf;
|
include /etc/yggbro/nginx/opennet/locations.conf;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user