Skip to content

Commit

Permalink
Add nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
kmagusiak committed Jan 26, 2025
1 parent 9db0072 commit 4892b02
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,14 @@ services:
POSTGRES_PASSWORD: ${PGPASSWORD}
POSTGRES_USER: ${PGUSER}
PGDATA: /var/lib/postgresql/data

http:
image: nginx
restart: unless-stopped
ports:
- 80:8080
volumes:
- ./scripts/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- odoo

35 changes: 35 additions & 0 deletions scripts/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
events {}

http {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

server {
listen 80;
# listen 443 ssl;

server_name odoo.localhost;

# ssl_certificate /etc/nginx/ssl/localhost.pem;
# ssl_certificate_key /etc/nginx/ssl/localhost.key;

location / {
proxy_pass http://odoo:8069;
}

location /longpolling/ {
proxy_http_version 1.1;
proxy_pass http://odoo:8072;
}

location /websocket {
proxy_http_version 1.1;
proxy_pass http://odoo:8072;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
}

0 comments on commit 4892b02

Please sign in to comment.