# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 4096;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 80;
listen [::]:80;
server_name _;
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 {
}
}
}
具体应用的配置,一般都是保存在路径/etc/nginx/conf.d。
server {
listen 80;
server_name composer.xx.com;
set $root_path '/opt/satis/web';
index index.html;
root $root_path;
autoindex on;
access_log off;
error_log off;
location /api/ {
proxy_pass http://localhost:8081;
}
}
端口8081对应的进程号是1342
[root@php_data conf.d]# ss -anlp | grep 8081
tcp LISTEN 0 128 [::]:8081 [::]:* users:(("manage",pid=1342,fd=3))
根据进程号,进一步查看进程启动命令。
也即satis_manage
[root@php_data conf.d]# ps -ef | grep 1342
root 1342 1301 0 Jul28 ? 00:00:18 /opt/satis_manage/manage
下一步,我们将进入/opt/satis_manage,查看其配置。
[root@php_data satis_manage]# ll /opt/satis_manage
total 17556
drwxr-xr-x 2 root root 42 Oct 31 08:49 conf
-rwxr-xr-x 1 501 games 17964865 Dec 15 2021 manage
-rw-r--r-- 1 root root 11742 Jul 28 08:47 supervisor.log
manage 是一个可执行应用程序。
看下conf的配置:
AppName = satis_manage
HttpPort = 8081
RunMode = Prod
AutoRender = false
CopyRequestBody = true
# EnableDocs = true
EnableAdmin = true
[satis]
configPath = "/opt/satis/satis.json"
buildShell = "/opt/satis/build.sh"
#/bin/bash
/usr/bin/php72 /opt/satis/bin/satis build /opt/satis/satis.json /opt/satis/web
{
"name": "私有Composer",
"homepage": "http://composer.xx.com",
"repositories": [
{
"type": "vcs",
"url": "git@192.168.50.25:php/lib-base.git"
},
{
"type": "vcs",
"url": "git@192.168.50.25:php/serv-tp.git"
},
{
"type": "vcs",
"url": "git@192.168.50.25:php/lib-auth.git"
},
{
"type": "vcs",
"url": "git@192.168.50.25:php/lib-common-service-client.git"
}
],
"config": {
"secure-http": false
}
}
浏览器访问http://{ip} 默认80端口。
从私库下载二方包。