Your domain: comfy.alphabtc.top
Virtualhost conf: /usr/local/nginx/conf/vhost/comfy.alphabtc.top.conf
Directory of: /data/wwwroot/comfy.alphabtc.top
修改配置文件信息, 然后重新激活我们的nginx 服务,这里我是对ComfyUi的后台应用程序进行的配置,注意这里的反向代理的文件的配置的,如果我么的应用程序使用了Webservice的服务,那么我们需要注意需要配置相关的路径,服务启动端口信息是 http://127.0.0.1:8188 参考的配置信息如下:
server {
listen 80;
listen [::]:80;
server_name comfy.alphabtc.top;
access_log /data/wwwlogs/comfy.alphabtc.top_nginx.log combined;
#index index.html index.htm index.php;
#root /data/wwwroot/comfy.alphabtc.top;
include /usr/local/nginx/conf/rewrite/none.conf;
#error_page 404 /404.html;
#error_page 502 /502.html;
location / {
# 添加反向代理到 127.0.0.1:8188
proxy_connect_timeout 600;
proxy_read_timeout 3600000;
proxy_send_timeout 3600000;
proxy_intercept_errors off;
proxy_http_version 1.1;
client_max_body_size 100G;
proxy_set_header Host $http_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_pass http://127.0.0.1:8188;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
proxy_pass http://127.0.0.1:8188;
expires 30d;
access_log off;
}
location ~ .*\.(js|css)?$ {
proxy_pass http://127.0.0.1:8188;
expires 7d;
access_log off;
}
location ~ /(\.user\.ini|\.ht|\.git|\.svn|\.project|LICENSE|README\.md) {
deny all;
}
location /.well-known {
allow all;
}
#好像ComfyUI的ws协议是通过/ws路径的,所以这里加上
location /ws {
proxy_pass http://127.0.0.1:8188;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection Upgrade;
}
}
接下来我们可以使用的配置文件的,激活Nginx 的配置选项
export PATH=$PATH:/usr/local/nginx/sbin