mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-08 22:24:17 +08:00
adding nginx templates
This commit is contained in:
parent
12c4fa33f5
commit
76258159f7
5 changed files with 141 additions and 130 deletions
|
@ -1,60 +0,0 @@
|
|||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
server_name dashboard.stage.netmaker.org; # The external URL
|
||||
client_max_body_size 0;
|
||||
|
||||
location / {
|
||||
|
||||
# if you use a custom resolver to find your app, needed with swag proxy
|
||||
# resolver 127.0.0.11 valid=30s;
|
||||
set $upstream_app dashboard; # The internal URL
|
||||
set $upstream_port 3000; # The internal Port
|
||||
set $upstream_proto http; # the protocol that is being used
|
||||
proxy_pass $upstream_proto://$upstream_app:$upstream_port; # combine the set variables from above
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
server_name api.stage.netmaker.org; # The external URL
|
||||
client_max_body_size 0;
|
||||
underscores_in_headers on;
|
||||
|
||||
location / {
|
||||
# if you use a custom resolver to find your app, needed with swag proxy
|
||||
# resolver 127.0.0.11 valid=30s;
|
||||
|
||||
set $upstream_app netmaker; # The internal URL
|
||||
set $upstream_port 8081; # The internal Port
|
||||
set $upstream_proto http; # the protocol that is being used
|
||||
proxy_pass $upstream_proto://$upstream_app:$upstream_port; # combine the set variables from above
|
||||
|
||||
# Forces the header to be the one that is visible from the outside
|
||||
proxy_set_header Host api.stage.netmaker.org; # Please cange to your URL
|
||||
|
||||
# Pass all headers through to the backend
|
||||
proxy_pass_request_headers on;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 http2;
|
||||
server_name grpc.stage.netmaker.org
|
||||
client_max_body_size 0;
|
||||
underscores_in_headers on;
|
||||
|
||||
|
||||
# Forces the header to be the one that is visible from the outside
|
||||
proxy_set_header Host api.stage.netmaker.org; # Please change to your URL
|
||||
|
||||
# Pass all headers through to the backend
|
||||
proxy_pass_request_headers on;
|
||||
|
||||
location / {
|
||||
grpc_pass grpc://localhost:50051;
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
server {
|
||||
listen 443;
|
||||
listen [::]:443;
|
||||
|
||||
server_name dashboard.stage.netmaker.org; # The external URL
|
||||
client_max_body_size 0;
|
||||
ssl_certificate /etc/letsencrypt/live/stage.netmaker.org/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/stage.netmaker.org/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
location / {
|
||||
|
||||
# if you use a custom resolver to find your app, needed with swag proxy
|
||||
# resolver 127.0.0.11 valid=30s;
|
||||
set $upstream_app dashboard; # The internal URL
|
||||
set $upstream_port 3000; # The internal Port
|
||||
set $upstream_proto http2; # the protocol that is being used
|
||||
proxy_pass $upstream_proto://$upstream_app:$upstream_port; # combine the set variables from above
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443;
|
||||
listen [::]:443;
|
||||
|
||||
server_name api.stage.netmaker.org; # The external URL
|
||||
client_max_body_size 0;
|
||||
underscores_in_headers on;
|
||||
ssl_certificate /etc/letsencrypt/live/stage.netmaker.org/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/stage.netmaker.org/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
location / {
|
||||
# if you use a custom resolver to find your app, needed with swag proxy
|
||||
# resolver 127.0.0.11 valid=30s;
|
||||
|
||||
set $upstream_app netmaker; # The internal URL
|
||||
set $upstream_port 8081; # The internal Port
|
||||
set $upstream_proto http2; # the protocol that is being used
|
||||
proxy_pass $upstream_proto://$upstream_app:$upstream_port; # combine the set variables from above
|
||||
|
||||
# Forces the header to be the one that is visible from the outside
|
||||
proxy_set_header Host api.stage.netmaker.org; # Please cange to your URL
|
||||
|
||||
# Pass all headers through to the backend
|
||||
proxy_pass_request_headers on;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 http2;
|
||||
server_name grpc.stage.netmaker.org
|
||||
client_max_body_size 0;
|
||||
underscores_in_headers on;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/stage.netmaker.org/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/stage.netmaker.org/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
# Forces the header to be the one that is visible from the outside
|
||||
proxy_set_header Host api.stage.netmaker.org; # Please change to your URL
|
||||
|
||||
# Pass all headers through to the backend
|
||||
proxy_pass_request_headers on;
|
||||
|
||||
location / {
|
||||
grpc_pass grpc://localhost:50051;
|
||||
}
|
||||
}
|
Binary file not shown.
96
nginx/netmaker-nginx-dns.conf
Normal file
96
nginx/netmaker-nginx-dns.conf
Normal file
|
@ -0,0 +1,96 @@
|
|||
user www-data;
|
||||
worker_processes auto;
|
||||
pid /run/nginx.pid;
|
||||
include /etc/nginx/modules-enabled/*.conf;
|
||||
|
||||
events {
|
||||
worker_connections 768;
|
||||
# multi_accept on;
|
||||
}
|
||||
|
||||
http {
|
||||
|
||||
##
|
||||
# Basic Settings
|
||||
##
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
# server_tokens off;
|
||||
|
||||
# server_names_hash_bucket_size 64;
|
||||
# server_name_in_redirect off;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
##
|
||||
# SSL Settings
|
||||
##
|
||||
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
##
|
||||
# Logging Settings
|
||||
##
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
##
|
||||
# Gzip Settings
|
||||
##
|
||||
|
||||
gzip on;
|
||||
|
||||
# gzip_vary on;
|
||||
# gzip_proxied any;
|
||||
# gzip_comp_level 6;
|
||||
# gzip_buffers 16 8k;
|
||||
# gzip_http_version 1.1;
|
||||
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
##
|
||||
# Virtual Host Configs
|
||||
##
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
}
|
||||
|
||||
|
||||
#mail {
|
||||
# # See sample authentication script at:
|
||||
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
|
||||
#
|
||||
# # auth_http localhost/auth.php;
|
||||
# # pop3_capabilities "TOP" "USER";
|
||||
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
|
||||
#
|
||||
# server {
|
||||
# listen localhost:110;
|
||||
# protocol pop3;
|
||||
# proxy on;
|
||||
# }
|
||||
#
|
||||
# server {
|
||||
# listen localhost:143;
|
||||
# protocol imap;
|
||||
# proxy on;
|
||||
# }
|
||||
#}
|
||||
stream {
|
||||
upstream dns_servers {
|
||||
server 127.0.0.1:5353;
|
||||
}
|
||||
server {
|
||||
listen 53 udp;
|
||||
listen 53;
|
||||
proxy_pass dns_servers;
|
||||
error_log /var/log/nginx/dns.log info;
|
||||
}
|
||||
}
|
45
nginx/netmaker-nginx-template.conf
Normal file
45
nginx/netmaker-nginx-template.conf
Normal file
|
@ -0,0 +1,45 @@
|
|||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
server_name dashboard.NETMAKER_BASE_DOMAIN;
|
||||
ssl_certificate /etc/letsencrypt/live/NETMAKER_BASE_DOMAIN/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/NETMAKER_BASE_DOMAIN/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8082;
|
||||
}
|
||||
}
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
server_name api.NETMAKER_BASE_DOMAIN;
|
||||
ssl_certificate /etc/letsencrypt/live/NETMAKER_BASE_DOMAIN/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/NETMAKER_BASE_DOMAIN/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8081;
|
||||
proxy_set_header Host api.NETMAKER_BASE_DOMAIN;
|
||||
proxy_pass_request_headers on;
|
||||
}
|
||||
}
|
||||
server {
|
||||
listen 1443 ssl http2;
|
||||
server_name grpc.NETMAKER_BASE_DOMAIN
|
||||
ssl_certificate /etc/letsencrypt/live/NETMAKER_BASE_DOMAIN/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/NETMAKER_BASE_DOMAIN/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
# Forces the header to be the one that is visible from the outside
|
||||
proxy_set_header Host api.NETMAKER_BASE_DOMAIN; # Please change to your URL
|
||||
|
||||
# Pass all headers through to the backend
|
||||
proxy_pass_request_headers on;
|
||||
|
||||
location / {
|
||||
grpc_pass grpc://127.0.0.1:50051;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue