Browse Source

refactor opennet conf

main
ghost 12 months ago
parent
commit
b24b24a672
  1. 16
      nginx/opennet/README.md
  2. 2
      nginx/opennet/handles/redirect.conf
  3. 29
      nginx/opennet/locations.conf
  4. 2
      nginx/opennet/locations/bsd.conf
  5. 2
      nginx/opennet/locations/cisco.conf
  6. 2
      nginx/opennet/locations/grab.conf
  7. 2
      nginx/opennet/locations/include/common.conf
  8. 2
      nginx/opennet/locations/linux.conf
  9. 2
      nginx/opennet/locations/m.conf
  10. 2
      nginx/opennet/locations/mobile.conf
  11. 2
      nginx/opennet/locations/palm.conf
  12. 2
      nginx/opennet/locations/security.conf
  13. 2
      nginx/opennet/locations/solaris.conf
  14. 2
      nginx/opennet/locations/web.conf
  15. 2
      nginx/opennet/locations/wiki.conf
  16. 2
      nginx/opennet/locations/www-less.conf
  17. 2
      nginx/opennet/locations/www.conf
  18. 11
      nginx/opennet/server.conf

16
nginx/opennet/README.md

@ -1,4 +1,4 @@ @@ -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:
@ -17,11 +17,17 @@ 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`
* `forum.opennet.ru` > `/opennet/wwwcgi-bin/openforum/vsluhboard.cgi`
## Installation
## Install
1. Download `nginx/opennet` content to `/etc/nginx/opennet` folder
2. Copy `nginx/opennet/server.conf` to `/etc/nginx/sites-available/opennet.conf` then change commented options for your needs
3. Alternatively, include `nginx/opennet/locations.conf` to existing website config at `sites-available` then reload nginx configuration
* `ln -s /etc/yggbro/nginx/opennet/server.conf /etc/nginx/sites-enabled/yggbro.opennet.conf`
* `nginx -t`
* `service nginx reload`
## Uninstall
* `rm /etc/nginx/sites-enabled/yggbro.opennet.conf`
* `nginx -t`
* `service nginx reload`
## Issues

2
nginx/opennet/locations/handle/redirect.conf → nginx/opennet/handles/redirect.conf

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
# Prevent out redirects (solution for issue #2)
location @opennet_locations_handle_redirect {
location @yggbro_nginx_opennet_handles_redirect {
set $original_uri $uri;
set $orig_loc $upstream_http_location;

29
nginx/opennet/locations.conf

@ -1,41 +1,38 @@ @@ -1,41 +1,38 @@
# www-less
include /etc/nginx/opennet/locations/www-less.conf;
include /etc/yggbro/nginx/opennet/locations/www-less.conf;
# www
include /etc/nginx/opennet/locations/www.conf;
include /etc/yggbro/nginx/opennet/locations/www.conf;
# bsd
include /etc/nginx/opennet/locations/bsd.conf;
include /etc/yggbro/nginx/opennet/locations/bsd.conf;
# cisco
include /etc/nginx/opennet/locations/cisco.conf;
include /etc/yggbro/nginx/opennet/locations/cisco.conf;
# grab
include /etc/nginx/opennet/locations/grab.conf;
include /etc/yggbro/nginx/opennet/locations/grab.conf;
# linux
include /etc/nginx/opennet/locations/linux.conf;
include /etc/yggbro/nginx/opennet/locations/linux.conf;
# m
include /etc/nginx/opennet/locations/m.conf;
include /etc/yggbro/nginx/opennet/locations/m.conf;
# mobile
include /etc/nginx/opennet/locations/mobile.conf;
include /etc/yggbro/nginx/opennet/locations/mobile.conf;
# palm
include /etc/nginx/opennet/locations/palm.conf;
include /etc/yggbro/nginx/opennet/locations/palm.conf;
# security
include /etc/nginx/opennet/locations/security.conf;
include /etc/yggbro/nginx/opennet/locations/security.conf;
# solaris
include /etc/nginx/opennet/locations/solaris.conf;
include /etc/yggbro/nginx/opennet/locations/solaris.conf;
# web
include /etc/nginx/opennet/locations/web.conf;
include /etc/yggbro/nginx/opennet/locations/web.conf;
# wiki
include /etc/nginx/opennet/locations/wiki.conf;
# handles (do not delete)
include /etc/nginx/opennet/locations/handle/redirect.conf;
include /etc/yggbro/nginx/opennet/locations/wiki.conf;

2
nginx/opennet/locations/bsd.conf

@ -4,7 +4,7 @@ location /opennet/bsd { @@ -4,7 +4,7 @@ location /opennet/bsd {
proxy_pass https://bsd.opennet.ru/;
# Include common rules
include /etc/nginx/opennet/locations/include/common.conf;
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
# Relative paths
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/bsd/';

2
nginx/opennet/locations/cisco.conf

@ -4,7 +4,7 @@ location /opennet/cisco { @@ -4,7 +4,7 @@ location /opennet/cisco {
proxy_pass https://cisco.opennet.ru/;
# Include common rules
include /etc/nginx/opennet/locations/include/common.conf;
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
# Relative paths
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/cisco/';

2
nginx/opennet/locations/grab.conf

@ -4,7 +4,7 @@ location /opennet/grab { @@ -4,7 +4,7 @@ location /opennet/grab {
proxy_pass https://grab.opennet.ru/;
# Include common rules
include /etc/nginx/opennet/locations/include/common.conf;
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
# Relative paths
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/grab/';

2
nginx/opennet/locations/include/common.conf

@ -8,7 +8,7 @@ proxy_set_header X-Real-IP $remote_addr; @@ -8,7 +8,7 @@ proxy_set_header X-Real-IP $remote_addr;
# Prevent out redirects (issue #2)
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
sub_filter_once off;

2
nginx/opennet/locations/linux.conf

@ -4,7 +4,7 @@ location /opennet/linux { @@ -4,7 +4,7 @@ location /opennet/linux {
proxy_pass https://linux.opennet.ru/;
# Include common rules
include /etc/nginx/opennet/locations/include/common.conf;
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
# Relative paths
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/linux/';

2
nginx/opennet/locations/m.conf

@ -4,7 +4,7 @@ location /opennet/m { @@ -4,7 +4,7 @@ location /opennet/m {
proxy_pass https://m.opennet.ru/;
# Include common rules
include /etc/nginx/opennet/locations/include/common.conf;
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
# Relative paths
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/m/';

2
nginx/opennet/locations/mobile.conf

@ -4,7 +4,7 @@ location /opennet/mobile { @@ -4,7 +4,7 @@ location /opennet/mobile {
proxy_pass https://mobile.opennet.ru/;
# Include common rules
include /etc/nginx/opennet/locations/include/common.conf;
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
# Relative paths
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/mobile/';

2
nginx/opennet/locations/palm.conf

@ -4,7 +4,7 @@ location /opennet/palm { @@ -4,7 +4,7 @@ location /opennet/palm {
proxy_pass https://palm.opennet.ru/;
# Include common rules
include /etc/nginx/opennet/locations/include/common.conf;
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
# Relative paths
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/palm/';

2
nginx/opennet/locations/security.conf

@ -4,7 +4,7 @@ location /opennet/security { @@ -4,7 +4,7 @@ location /opennet/security {
proxy_pass https://security.opennet.ru/;
# Include common rules
include /etc/nginx/opennet/locations/include/common.conf;
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
# Relative paths
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/security/';

2
nginx/opennet/locations/solaris.conf

@ -4,7 +4,7 @@ location /opennet/solaris { @@ -4,7 +4,7 @@ location /opennet/solaris {
proxy_pass https://solaris.opennet.ru/;
# Include common rules
include /etc/nginx/opennet/locations/include/common.conf;
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
# Relative paths
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/solaris/';

2
nginx/opennet/locations/web.conf

@ -4,7 +4,7 @@ location /opennet/web { @@ -4,7 +4,7 @@ location /opennet/web {
proxy_pass https://web.opennet.ru/;
# Include common rules
include /etc/nginx/opennet/locations/include/common.conf;
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
# Relative paths
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/web/';

2
nginx/opennet/locations/wiki.conf

@ -4,7 +4,7 @@ location /opennet/wiki { @@ -4,7 +4,7 @@ location /opennet/wiki {
proxy_pass https://wiki.opennet.ru/;
# Include common rules
include /etc/nginx/opennet/locations/include/common.conf;
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
# Relative paths
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/wiki/';

2
nginx/opennet/locations/www-less.conf

@ -4,7 +4,7 @@ location /opennet { @@ -4,7 +4,7 @@ location /opennet {
proxy_pass https://opennet.ru/;
# Include common rules
include /etc/nginx/opennet/locations/include/common.conf;
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
# Relative paths
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/opennet/';

2
nginx/opennet/locations/www.conf

@ -4,7 +4,7 @@ location /opennet/www { @@ -4,7 +4,7 @@ location /opennet/www {
proxy_pass https://www.opennet.ru/;
# Include common rules
include /etc/nginx/opennet/locations/include/common.conf;
include /etc/yggbro/nginx/opennet/locations/include/common.conf;
# Relative paths
sub_filter 'action="/' 'action="http://[$server_addr]/opennet/www/';

11
nginx/opennet/server.conf

@ -1,12 +1,15 @@ @@ -1,12 +1,15 @@
server {
# HTTP/IPv6 connections only
# listen [::]:80 ipv6only=on _;
listen [::]:80;
# Yggdrasil connections only
# allow 0200::/7;
# deny all;
allow 0200::/7;
deny all;
# Include handles
include /etc/yggbro/nginx/opennet/handles/redirect.conf;
# Include available locations
include /etc/nginx/opennet/locations.conf;
include /etc/yggbro/nginx/opennet/locations.conf;
}
Loading…
Cancel
Save