Skip to content

Commit

Permalink
Disabling HTTPS and switching to Noto port
Browse files Browse the repository at this point in the history
  • Loading branch information
Rmarieta committed Jan 12, 2024
1 parent e53c690 commit 3764498
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 16 deletions.
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ services:
image: nginx:latest
container_name: nginx
ports:
- "80:80"
- "443:443"
- "1015:80"
# - "443:443"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/ssl-certs:/etc/nginx/ssl-certs
# - ./nginx/ssl-certs:/etc/nginx/ssl-certs
depends_on:
- flask_1
- flask_2
Expand Down
38 changes: 38 additions & 0 deletions nginx/conf.d/old_server_HTTPS.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
server {
listen 80;
server_name localhost;

# redirect HTTP to HTTPS
return 301 https://$host$request_uri;
}

upstream flask_nodes {
ip_hash;

server flask_1:5000;
server flask_2:5000;
}

server {
listen 443 ssl;
server_name localhost;

ssl_certificate /etc/nginx/ssl-certs/localhost.crt;
ssl_certificate_key /etc/nginx/ssl-certs/localhost.key;

location / {
proxy_pass http://flask_nodes/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Prefix /;
}

location /socket.io {
proxy_pass http://flask_nodes/socket.io;
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
14 changes: 2 additions & 12 deletions nginx/conf.d/server.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
server {
listen 80;
server_name localhost;

# redirect HTTP to HTTPS
return 301 https://$host$request_uri;
}

upstream flask_nodes {
ip_hash;
Expand All @@ -14,11 +7,8 @@ upstream flask_nodes {
}

server {
listen 443 ssl;
server_name localhost;

ssl_certificate /etc/nginx/ssl-certs/localhost.crt;
ssl_certificate_key /etc/nginx/ssl-certs/localhost.key;
listen 80;
server_name _;

location / {
proxy_pass http://flask_nodes/;
Expand Down
2 changes: 1 addition & 1 deletion nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ events {

http {
# include the other config files
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/conf.d/server.conf;
}

0 comments on commit 3764498

Please sign in to comment.