diff --git a/devops/controller.service b/devops/controller.service index 34dd7f7..dff8900 100644 --- a/devops/controller.service +++ b/devops/controller.service @@ -2,7 +2,7 @@ Description=TR-369 Controller [Service] -ExecStart=/usr/bin/controller -u 'root' -P '' -mongo '' -p 8883 -tls +ExecStart=/usr/bin/controller -u 'root' -P '' -mongo '' -ap 8001 Restart=always RestartSec=4 diff --git a/devops/nginx.conf b/devops/nginx.conf index 8a5d29c..aa8dc9e 100644 --- a/devops/nginx.conf +++ b/devops/nginx.conf @@ -35,51 +35,59 @@ http { include /etc/nginx/conf.d/*.conf; server { - if ($host = oktopus.ifsc.digital) { + if ($host = oktopustr369.com) { return 301 https://$host$request_uri; } listen 80; listen [::]:80; - server_name oktopus.ifsc.digital; + server_name oktopustr369.com; return 404; } server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - server_name oktopus.ifsc.digital; - root /usr/share/nginx/html; + listen 443 http2; + listen [::]:443 ssl http2; + server_name oktopustr369.com; + root /usr/share/nginx/html; - # Load configuration files for the default server block. - include /etc/nginx/default.d/*.conf; + # Load configuration files for the default server block. + include /etc/nginx/default.d/*.conf; - ssl_certificate "/etc/letsencrypt/live/oktopus.ifsc.digital/fullchain.pem"; - ssl_certificate_key "/etc/letsencrypt/live/oktopus.ifsc.digital/privkey.pem"; - ssl_session_cache shared:SSL:1m; - ssl_session_timeout 10m; - ssl_ciphers PROFILE=SYSTEM; - ssl_prefer_server_ciphers on; + ssl_certificate "/etc/letsencrypt/live/oktopustr369.com/fullchain.pem"; + ssl_certificate_key "/etc/letsencrypt/live/oktopustr369.com/privkey.pem"; + ssl_session_cache shared:SSL:1m; + ssl_session_timeout 10m; + ssl_ciphers PROFILE=SYSTEM; + ssl_prefer_server_ciphers on; - error_page 404 /404.html; - location = /404.html { + location / { + proxy_pass http://127.0.0.1:3000; + proxy_read_timeout 60; + proxy_connect_timeout 60; + proxy_redirect off; + + # Allow the use of websockets + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } + + location /api { + proxy_pass http://127.0.0.1:8001; + proxy_read_timeout 60; + proxy_connect_timeout 60; + proxy_redirect off; + + # Allow the use of websockets + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } } - location / { - proxy_pass http://127.0.0.1:3000; - proxy_read_timeout 60; - proxy_connect_timeout 60; - proxy_redirect off; - - # Allow the use of websockets - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - } } -} \ No newline at end of file +