[NGINX] proxy server for python apps - fourslickz/notes GitHub Wiki
nginx.conf
server {
listen 80;
#listen [::]:80;
server_name default;
#root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
#error_page 404 /404.html;
#location = /404.html {
#}
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
#}
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_max_temp_file_size 0;
client_body_buffer_size 100M;
}
}
/etc/systemd/system/remove-background.service
[Unit]
Description=Remove Background Services
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/rembg s
TimeoutStartSec=0
StandardOutput=append:/var/log/rembg.log
StandardError=append:/var/log/rembg.log
[Install]
WantedBy=default.target