Skip to content

Commit

Permalink
chore: containers config and nginx config
Browse files Browse the repository at this point in the history
  • Loading branch information
ramamimu committed Feb 16, 2024
1 parent 1d1428d commit 3f22429
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 53 deletions.
12 changes: 12 additions & 0 deletions containers/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "1.0"

services:
postgres:
container_name: postgresDb
image: postgres:9.6
ports:
- "5433:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
12 changes: 12 additions & 0 deletions containers/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "1.0"

services:
postgres:
container_name: np-postgresDb
image: postgres:9.6
ports:
- "5434:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
114 changes: 61 additions & 53 deletions nginx.config
Original file line number Diff line number Diff line change
@@ -1,71 +1,79 @@
limit_req_zone $binary_remote_addr zone=one:10m rate=90r/m;
server {
listen 80 default_server;
listen [::]:80 default_server;

root /var/www/html;

index index.html index.htm index.nginx-debian.html;

server_name _;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
proxy_pass http://localhost:5000; # your app's port
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;
limit_req zone=one;
}
server {
listen 80 default_server;
listen [::]:80 default_server;

root /var/www/html;

index index.html index.htm index.nginx-debian.html;

server_name _;

location / {
proxy_pass http://localhost:5000; # your app's port
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 /threads {
limit_req zone=one;
proxy_pass http://localhost:5000; # your app's port
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;
}
}

server {

root /var/www/html;

index index.html index.htm index.nginx-debian.html;
server_name www.social-news-wear-slowly.a276.dcdg.xyz social-news-wear-slowly.a276.dcdg.xyz; # managed by Certbot


location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
proxy_pass http://localhost:5000; # your app's port
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;
limit_req zone=one;
}


listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/social-news-wear-slowly.a276.dcdg.xyz/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/social-news-wear-slowly.a276.dcdg.xyz/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
root /var/www/html;

index index.html index.htm index.nginx-debian.html;
server_name www.social-news-wear-slowly.a276.dcdg.xyz social-news-wear-slowly.a276.dcdg.xyz; # managed by Certbot

location / {
proxy_pass http://localhost:5000; # your app's port
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 /threads {
limit_req zone=one;
proxy_pass http://localhost:5000; # your app's port
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;
}

listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/social-news-wear-slowly.a276.dcdg.xyz/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/social-news-wear-slowly.a276.dcdg.xyz/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

server {
if ($host = www.social-news-wear-slowly.a276.dcdg.xyz) {
return 301 https://$host$request_uri;
} # managed by Certbot


if ($host = social-news-wear-slowly.a276.dcdg.xyz) {
return 301 https://$host$request_uri;
} # managed by Certbot


listen 80 ;
listen [::]:80 ;
listen 80 ;
listen [::]:80 ;
server_name www.social-news-wear-slowly.a276.dcdg.xyz social-news-wear-slowly.a276.dcdg.xyz;
return 404; # managed by Certbot
}
}

0 comments on commit 3f22429

Please sign in to comment.