chore: sync submodule state (parent ref update)
Made-with: Cursor
This commit is contained in:
12
deployment/common/README.md
Normal file
12
deployment/common/README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# deployment-common
|
||||
|
||||
Reusable deployment snippets (nginx, systemd, Cloudflare, fail2ban).
|
||||
Use as reference or copy into your project.
|
||||
|
||||
## Contents
|
||||
|
||||
- **nginx-api-location.conf** – Generic `location /api/` proxy snippet (upstream host/port to be adjusted).
|
||||
- **systemd-api-service.example** – Example systemd unit for a REST API (env and paths to be adjusted).
|
||||
- **cloudflare / fail2ban** – See parent `../cloudflare/` and `../fail2ban/` for full configs.
|
||||
|
||||
When this is a separate repo, add as submodule at `deployment/common`.
|
||||
16
deployment/common/nginx-api-location.conf
Normal file
16
deployment/common/nginx-api-location.conf
Normal file
@@ -0,0 +1,16 @@
|
||||
# Generic snippet: proxy /api/ to a backend (Blockscout, Go API, etc.)
|
||||
# Include in your server block. Replace upstream host/port as needed.
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://127.0.0.1:4000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
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_read_timeout 300s;
|
||||
proxy_connect_timeout 75s;
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
|
||||
add_header Access-Control-Allow-Headers "Content-Type";
|
||||
}
|
||||
21
deployment/common/systemd-api-service.example
Normal file
21
deployment/common/systemd-api-service.example
Normal file
@@ -0,0 +1,21 @@
|
||||
# Example systemd unit for a REST API (e.g. explorer API on port 8080)
|
||||
# Copy to /etc/systemd/system/explorer-api.service and adjust paths/env.
|
||||
|
||||
[Unit]
|
||||
Description=Explorer REST API
|
||||
After=network.target postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=explorer
|
||||
WorkingDirectory=/opt/explorer
|
||||
Environment=PORT=8080
|
||||
Environment=DB_HOST=localhost
|
||||
Environment=DB_NAME=explorer
|
||||
Environment=CHAIN_ID=138
|
||||
ExecStart=/opt/explorer/bin/api-server
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user