remove nginx

This commit is contained in:
2026-04-10 00:25:43 +02:00
parent 9223e4d35f
commit db0a46a0b5
7 changed files with 29 additions and 12 deletions
+3 -3
View File
@@ -777,13 +777,13 @@ services:
- DATABASE_URL=sqlite:///data/astronome.db - DATABASE_URL=sqlite:///data/astronome.db
- RUST_LOG=info - RUST_LOG=info
ports: ports:
- "3301:3301" - "3001:3001"
frontend: frontend:
build: ./frontend build: ./frontend
restart: unless-stopped restart: unless-stopped
ports: ports:
- "3300:80" - "3000:80"
depends_on: depends_on:
- backend - backend
@@ -801,7 +801,7 @@ services:
```nginx ```nginx
# nginx-conf.conf — reverse proxy, single origin for browser # nginx-conf.conf — reverse proxy, single origin for browser
upstream backend { server backend:3301; } upstream backend { server backend:3001; }
upstream frontend { server frontend:80; } upstream frontend { server frontend:80; }
server { server {
+2
View File
@@ -0,0 +1,2 @@
# gitea token
4fe62748b43ca89f8bb0472b810aac49fa1fac8d
+1 -1
View File
@@ -37,7 +37,7 @@ async fn main() -> anyhow::Result<()> {
let app = api::build_router(pool).layer(cors); let app = api::build_router(pool).layer(cors);
let bind_addr = "0.0.0.0:3301"; let bind_addr = "0.0.0.0:3001";
tracing::info!("Starting server on {}", bind_addr); tracing::info!("Starting server on {}", bind_addr);
let listener = tokio::net::TcpListener::bind(bind_addr).await?; let listener = tokio::net::TcpListener::bind(bind_addr).await?;
+2 -2
View File
@@ -8,13 +8,13 @@ services:
- DATABASE_URL=sqlite:///data/astronome.db - DATABASE_URL=sqlite:///data/astronome.db
- RUST_LOG=info - RUST_LOG=info
ports: ports:
- "3301:3301" - "3001:3001"
frontend: frontend:
build: ./frontend build: ./frontend
restart: unless-stopped restart: unless-stopped
ports: ports:
- "3300:80" - "3000:80"
depends_on: depends_on:
- backend - backend
+11 -2
View File
@@ -1,15 +1,24 @@
server { server {
listen 80; listen 80;
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html; index index.html;
default_type application/octet-stream;
location / { location / {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
# Cache static assets location = /index.html {
expires -1;
add_header Cache-Control "no-cache";
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
expires 1y; expires 1y;
add_header Cache-Control "public, immutable"; add_header Cache-Control "public, immutable";
} }
}
add_header X-Content-Type-Options nosniff;
}
+1 -1
View File
@@ -6,7 +6,7 @@ export default defineConfig({
server: { server: {
proxy: { proxy: {
'/api': { '/api': {
target: 'http://localhost:3301', target: 'http://localhost:3001',
changeOrigin: true, changeOrigin: true,
}, },
}, },
+9 -3
View File
@@ -3,17 +3,23 @@ events {
} }
http { http {
upstream backend { server backend:3301; } upstream backend { server backend:3001; }
upstream frontend { server frontend:80; } upstream frontend { server frontend:80; }
server { server {
listen 80; listen 80;
server_name _;
client_max_body_size 60M; client_max_body_size 60M;
location /api/ { location /api/ {
proxy_pass http://backend; proxy_pass http://backend/;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 10s;
proxy_read_timeout 60s; proxy_read_timeout 60s;
} }
@@ -22,4 +28,4 @@ http {
proxy_set_header Host $host; proxy_set_header Host $host;
} }
} }
} }