Comments (2)
When I do that, I got a 502 error from nginx
*2665 connect() failed (111: Connection refused) while connecting to upstream, client: 92.70.xxx.xxx, server: books.sebastix.social, request: "GET /setup HTTP/1.1", upstream: "http://127.0.0.1:8001/setup"
from documentation.
docker-compose.yml
version: '3'
services:
nginx:
image: nginx:latest
restart: unless-stopped
ports:
- "8001:8001"
depends_on:
- web
networks:
- main
volumes:
- ./nginx:/etc/nginx/conf.d
- static_volume:/app/static
- media_volume:/app/images
db:
image: postgres:13
env_file: .env
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- main
web:
build: .
env_file: .env
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/app
- static_volume:/app/static
- media_volume:/app/images
depends_on:
- db
- celery_worker
- redis_activity
networks:
- main
ports:
- "8000"
in bookwyrm /nginx/default.conf
include /etc/nginx/conf.d/server_config;
upstream web {
server web:8000;
}
in /etc/nginx/sites-enabled/book.yourdomain.com
server {
if ($host = book.yourdomain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name book.yourdomain.com;
listen [::]:80;
listen 80;
add_header Strict-Transport-Security "max-age=31536000;includeSubDomains" always;
location / { return 301 https://$host$request_uri; }
}
server {
listen [::]:443 ssl http2;
listen 443 ssl http2;
# SSL code
ssl_certificate /etc/letsencrypt/live/book.yourdomain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/book.yourdomain.com/privkey.pem; # managed by Certbot
server_name book.yourdomain.com;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
location / {
proxy_pass http://localhost:8001;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
location /images/ {
proxy_pass http://localhost:8001;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
location /static/ {
proxy_pass http://localhost:8001;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
}
This is working for me
from documentation.
Related Issues (20)
- Add instructions for enabling intellisense to dev environments
- markdown formatting not translating to documentation site
- "Contribute to this page" link points to the wrong repo
- add info for admins on managing federation
- External Storage instructions work with Linode/Akamai HOT 4
- Local Dev first setup should mention turning off https to prevent CSRF problems HOT 1
- Error deploying docs site HOT 4
- Documentation update + certbot error
- document `Move` and account migration for users
- "Contribute to this page" doesn't take the user to that page's source.
- Official list link no longer exists HOT 2
- posted this issue in wrong folder.. but cant delete. sorry.
- Example data in developer environment HOT 4
- Broken update documentation link
- Installing in Production page - using a reverse proxy 404 not found HOT 1
- Document flower / celery HOT 1
- Documentations says nothing about the different IDs
- dockerless instructions updates
- Add new instance to offical list
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documentation.