<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.linuxsa.org/index.php?action=history&amp;feed=atom&amp;title=Nginx%E4%BA%8C%E7%BA%A7%E7%9B%AE%E5%BD%95Nginx%E5%88%B6%E4%BD%9C%E4%B8%8B%E8%BD%BD%E7%AB%99%E7%82%B9</id>
	<title>Nginx二级目录Nginx制作下载站点 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.linuxsa.org/index.php?action=history&amp;feed=atom&amp;title=Nginx%E4%BA%8C%E7%BA%A7%E7%9B%AE%E5%BD%95Nginx%E5%88%B6%E4%BD%9C%E4%B8%8B%E8%BD%BD%E7%AB%99%E7%82%B9"/>
	<link rel="alternate" type="text/html" href="https://wiki.linuxsa.org/index.php?title=Nginx%E4%BA%8C%E7%BA%A7%E7%9B%AE%E5%BD%95Nginx%E5%88%B6%E4%BD%9C%E4%B8%8B%E8%BD%BD%E7%AB%99%E7%82%B9&amp;action=history"/>
	<updated>2026-04-19T09:18:40Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.linuxsa.org/index.php?title=Nginx%E4%BA%8C%E7%BA%A7%E7%9B%AE%E5%BD%95Nginx%E5%88%B6%E4%BD%9C%E4%B8%8B%E8%BD%BD%E7%AB%99%E7%82%B9&amp;diff=741&amp;oldid=prev</id>
		<title>Evan：​/* trouble */</title>
		<link rel="alternate" type="text/html" href="https://wiki.linuxsa.org/index.php?title=Nginx%E4%BA%8C%E7%BA%A7%E7%9B%AE%E5%BD%95Nginx%E5%88%B6%E4%BD%9C%E4%B8%8B%E8%BD%BD%E7%AB%99%E7%82%B9&amp;diff=741&amp;oldid=prev"/>
		<updated>2020-11-03T12:16:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;trouble&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=nginx二级目录=&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
nginx 子目录   index 后面没 ; 会导致 刷新 404;  注意 alias这一行的最后面 要有 /  不然 会403的&lt;br /&gt;
&lt;br /&gt;
#可放最后面&lt;br /&gt;
    location /admin/ {&lt;br /&gt;
          alias /var/www/test-topen-hailuo/admin/;&lt;br /&gt;
          index index.html;&lt;br /&gt;
          try_files $uri $uri/ /admin/index.html;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=安全的文件下载站点=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       location /file/ {&lt;br /&gt;
          alias /home/love/files/im/;&lt;br /&gt;
       }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
visa url/file/logo.png&lt;br /&gt;
=trouble=&lt;br /&gt;
有时老是 403 解决办法 1 用root 运行nginx 2 看一下文件的家目录用户 是哪个 如果文件的家目录是evan 建议nginx用户 也是evan&lt;br /&gt;
 如果你放在 /home/evan   那么 nginx.conf     建议 user evan; 而不要原来的 user nginx;&lt;br /&gt;
&lt;br /&gt;
=start=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat bcb-down.llia.net.conf&lt;br /&gt;
server {&lt;br /&gt;
       listen 80;&lt;br /&gt;
       server_name bcb-down.llia.net;&lt;br /&gt;
       access_log  /var/log/nginx/1static_ecosystem.log;&lt;br /&gt;
       client_max_body_size 10m;&lt;br /&gt;
&lt;br /&gt;
        root  /home/f14;&lt;br /&gt;
        charset utf-8;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
location /  {&lt;br /&gt;
        autoindex on;&lt;br /&gt;
        autoindex_exact_size on;&lt;br /&gt;
        autoindex_localtime on;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/usr/local/nginx/sbin/nginx -t&lt;br /&gt;
&lt;br /&gt;
/usr/local/nginx/sbin/nginx -s reload&lt;br /&gt;
&lt;br /&gt;
NAT VM &lt;br /&gt;
&lt;br /&gt;
 sites]# cat    bcb-down.lliao.net.conf&lt;br /&gt;
server&lt;br /&gt;
{&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name bcb-down.lli.net;&lt;br /&gt;
&lt;br /&gt;
    location / {&lt;br /&gt;
      proxy_pass http://192.168.11.245:80; #转发地址:端口 #写错了IP  哈哈  许总作了泛DNS&lt;br /&gt;
      proxy_http_version 1.1;&lt;br /&gt;
      proxy_set_header Host             $host;&lt;br /&gt;
      proxy_set_header X-Real-IP        $remote_addr;&lt;br /&gt;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;br /&gt;
      proxy_set_header Upgrade $http_upgrade;&lt;br /&gt;
      proxy_set_header Connection &amp;quot;upgrade&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
 bash -x   docker_reload_nginx.sh&lt;br /&gt;
&lt;br /&gt;
 cat   docker_reload_nginx.sh&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
#author:chunk&lt;br /&gt;
#date:2019-07-22&lt;br /&gt;
#docker reload nginx&lt;br /&gt;
echo &amp;quot;==================== start docker reload nginx ==========================&amp;quot;&lt;br /&gt;
&lt;br /&gt;
docker exec -it dockerforservices_nginx_1 sh -c &amp;quot;nginx -t &amp;amp;&amp;amp; nginx -s reload&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
外网用4g打不开 原来是自己写错IP了 &lt;br /&gt;
http://bcb-down.lliao.net/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=see also=&lt;br /&gt;
[https://www.cnblogs.com/llody/p/10869689.html 使用Nginx制作下载站点]&lt;br /&gt;
&lt;br /&gt;
[https://cloud.tencent.com/info/72959727b73eef0285178c1559e41b12.html nginx 配置文件下载及在线浏览]&lt;br /&gt;
&lt;br /&gt;
[[category:ops]] [[category:nginx]]&lt;/div&gt;</summary>
		<author><name>Evan</name></author>
	</entry>
</feed>