-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
177 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ pid /var/run/nginx.pid; | |
|
||
|
||
events { | ||
worker_connections 1024; | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
worker_processes 1; | ||
|
||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log; | ||
error_log /var/log/nginx/error.log; | ||
|
||
sendfile on; | ||
tcp_nopush on; | ||
|
||
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=novamusic_cache:15m max_size=2g inactive=60s use_temp_path=off; | ||
|
||
gzip on; | ||
gzip_types text/plain text/css text/javascript text/xml application/json application/javascript image/svg; | ||
|
||
upstream user_service { | ||
server novamusic-user:8080; | ||
} | ||
|
||
upstream track_service { | ||
server novamusic-track:8080; | ||
} | ||
|
||
upstream album_service { | ||
server novamusic-album:8080; | ||
} | ||
|
||
upstream playlist_service { | ||
server novamusic-playlist:8080; | ||
} | ||
|
||
upstream artist_service { | ||
server novamusic-artist:8080; | ||
} | ||
|
||
upstream genre_service { | ||
server novamusic-genre:8080; | ||
} | ||
|
||
upstream csat_service { | ||
server novamusic-csat:8080; | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name novamusic; | ||
|
||
return 301 https://nova-music.ru$request_uri;; | ||
} | ||
|
||
server { | ||
listen 443 default_server ssl; | ||
server_name novamusic; | ||
|
||
http2 on; | ||
http2_max_concurrent_streams 128; | ||
keepalive_requests 1000; | ||
|
||
ssl_certificate /etc/ssl/nova-music.ru/fullchain.pem; | ||
ssl_certificate_key /etc/ssl/nova-music.ru/privkey.pem; | ||
|
||
ssl_protocols TLSv1.2 TLSv1.3; | ||
ssl_ciphers 'TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256'; | ||
|
||
add_header Host $http_host; | ||
add_header Origin $http_origin; | ||
add_header X-Real-IP $remote_addr; | ||
add_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
add_header X-Forwarded-Proto $scheme; | ||
add_header Content-Type $http_content_type; | ||
|
||
location /api/v1/users { | ||
proxy_pass http://user_service/api/v1/users; | ||
} | ||
|
||
location /api/v1/auth { | ||
proxy_pass http://user_service/api/v1/auth; | ||
} | ||
|
||
location /api/v1/health { | ||
proxy_pass http://user_service/api/v1/health; | ||
} | ||
|
||
location /api/v1/tracks { | ||
proxy_pass http://track_service/api/v1/tracks; | ||
} | ||
|
||
location /api/v1/albums { | ||
proxy_pass http://album_service/api/v1/albums; | ||
} | ||
|
||
location /api/v1/playlists { | ||
proxy_pass http://playlist_service/api/v1/playlists; | ||
} | ||
|
||
location /api/v1/artists { | ||
proxy_pass http://artist_service/api/v1/artists; | ||
} | ||
|
||
location /api/v1/genres { | ||
proxy_pass http://genre_service/api/v1/genres; | ||
} | ||
|
||
location /api/v1/csat { | ||
proxy_pass http://csat_service/api/v1/csat; | ||
} | ||
|
||
location / { | ||
proxy_cache novamusic_cache; | ||
proxy_cache_valid 200 30m; | ||
|
||
root /var/www/dist; | ||
index index.html; | ||
try_files $uri /index.html; | ||
} | ||
} | ||
} | ||
|