• nginx 普通用户启动配置 && springbootswagger 报错 Unable to infer base url 断舍离


    看nginx-error日志为:

    2022/01/04 08:50:55 [crit] 8715#8715: *107201 mkdir() "/var/cache/nginx/proxy_temp/3" failed (13: Permission denied) while reading upstream, client: 192.168.181.166, server: localhost, request: "GET /prod-api/swagger-ui/swagger-ui-standalone-preset.js?v=3.0.0 HTTP/1.1", upstream: "http://[::1]:8090/swagger-ui/swagger-ui-standalone-preset.js?v=3.0.0", host: "hostname:9000", referrer: "http://hostname:9000/prod-api/swagger-ui/index.html".

     发现没有 /var/cache/nginx/proxy/temp权限。 授权即可。

    sudo chmod a+w /var/cache/nginx/proxy_temp -R

    ==========https://www.cnblogs.com/java2sap/p/15761224.html

    另附: nginx yum安装&普通用户使用(普通用户不能用0-1024之间端口)

    转自:https://www.leelib.com/2014/10/31/yum-install-last-nginx.html

    添加nginx的repo

    echo '[nginx]
    name=nginx repo
    baseurl=http://nginx.org/packages/centos/7/x86_64
    gpgcheck=0
    enabled=1' > /etc/yum.repos.d/nginx.repo

    安装

    yum update
    yum install nginx

    是不是直接安装了最新版的nginx呢  :)

    log]$ whereis nginx
    nginx: /usr/sbin/nginx /usr/lib64/nginx /etc/nginx /usr/share/nginx /usr/share/man/man8/nginx.8.gz

    然后需要配置 nginx的普通用户路径. 创建相关目录,拷贝配置文件。授权proxy_temp . 如上。

    log]$ mkdir -p /data/nginx/log /data/nginx/run  /data/nginx/conf.d

    log]$ cp /etc/nginx/nginx.conf /data/nginx/

    log]$ cp /etc/nginx/conf.d/default.conf /data/nginx/conf.d/

     sudo chmod a+w /var/cache/nginx/proxy_temp -R

     log]$ vi /data/nginx/nginx.conf

    #user  nobody;
    worker_processes  auto;
    
    error_log  /data/nginx/log/error.log notice;
    pid        /data/nginx/run/nginx.pid;
    
    
    events {
        use epoll;
        worker_connections  1024;
    }
    
    
    http {
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;
    
        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  /data/nginx/log/access.log  main;
    
        sendfile        on;
        #tcp_nopush     on;
    
        keepalive_timeout  65;
    
        #gzip  on;
    
        include /data/nginx/conf.d/*.conf;
    }

    如有帮当你,点个赞吧

    mark。.

    博客地址: https://www.cnblogs.com/java2sap/
    世界丰富多彩,知识天花乱坠。
    ---如果有帮到你,点个赞吧~
  • 相关阅读:
    SQL Server AUTO_FIX_Login_Users
    SQL Server Always On 切换主机Login和User无法匹配解决方案
    SQL Server 目标主体名称不正确,无法生成 SSPI 上下文
    SQL Server Rebuild Index
    jqery和js如何判断checkbox是否选中 (转)
    jxl
    jxl 管理excel
    Bootstrap库之Modals
    jquery attr()
    js 验证数字(验证字符串是否是数字)
  • 原文地址:https://www.cnblogs.com/java2sap/p/15761224.html
Copyright © 2020-2023  润新知