仓库Nginx配置文件

公司Nginx仓库配置文件

root@178hub:~# cat /usr/local/nginx/conf/nginx.conf|grep -v "#"
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    include       conf.d/*.conf;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen 80;
        server_name localhost;

        # 显示目录
        autoindex on;
        location / {
            index index.html index.htm;
            root /data/apt/;
        }
        location /init {
            index index.html index.htm;
            root /data/git_data/conf/;
        }
        location /prod {
            index index.html index.htm;
            root /data/git_data/conf/;
        }
        location /soft {
            index index.html index.htm;
            root /data/soft;
        }
        location /temp {
            index index.html index.htm;
            root /data/temp;
        }

        access_log /var/log/nginx/localhost.log;
    }
}

转载于:https://www.cnblogs.com/alilinux/p/7338518.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
如果要配置Nginx作为代理服务器,你可以按照以下步骤进行配置: 1. 首先,在编译Nginx时需要加入`--with-http_ssl_module`参数,以支持代理https地址。可以使用以下命令进行编译配置: ``` ./configure --prefix=/usr/local/nginx --with-http_ssl_module ``` 2. 其次,为了实现代理功能,你需要在Nginx配置文件中添加相关配置。假设你的服务器IP为`proxy_ip`,配置如下: ``` server { listen 80; server_name your_domain.com; location / { proxy_pass http://proxy_ip; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } ``` 这里的`your_domain.com`是你希望通过该域名访问代理的地址,`proxy_ip`是你配置Nginx代理服务器的IP。 3. 最后,在裸金属服务器上执行`git clone`时,将原本填写的`codehub`域名地址改为你配置Nginx代理的IP。这样就可以通过Nginx代理服务器来访问内部的代码仓库了。 请注意,以上是一种常见的Nginx配置代理的方法,具体配置还需要根据你的实际情况进行调整。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [nginx配置代理](https://blog.csdn.net/weixin_44147924/article/details/124152594)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值