AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-207135

hamidfzm's questions

Martin Hope
hamidfzm
Asked: 2014-03-12 07:27:02 +0800 CST

在 nginx 中禁用恢复下载功能

  • 2

有什么办法可以在 nginx 服务器中禁用恢复下载?我想停止从 URL 中恢复下载功能,example.com/media/但我不知道该怎么做。我也通过互联网搜索过,但我找不到任何与 nginx 相关的内容。是服务器配置吗?还是我应该做点别的?这是我的服务器配置:

# sites-avalaible/default
server {
        listen  80;
        listen  443 ssl;
        server_name     www.example.com example.com;
        ssl_certificate /var/www/example/ssl/ssl.crt;
        ssl_certificate_key     /var/www/example/ssl/ssl.key;
        location /static  {
                alias   /var/www/example/static;
                expires 7d;
                add_header Pragma public;
                add_header Cache-Control "public, must-revalidate, proxy-revalidate";

        }
        location /media  {
                alias  /var/www/example/media;
                # limit download speed after 5mb download
                limit_rate_after 5m;
                limit_rate 120k;
                limit_req zone=lh burst=5 nodelay;
        }
        location / {
                proxy_pass      http://127.0.0.1:8000;
        }
}
nginx
  • 1 个回答
  • 3942 Views
Martin Hope
hamidfzm
Asked: 2014-03-08 10:31:56 +0800 CST

为特定 url 启用 nginx 浏览器缓存

  • 3

如何为特定 URL 启用 nginx 缓存?我有一个 django web 应用程序,我将我的静态文件(如 CSS、JavaScript 和 ...)放在一个名为 static 的文件夹中,我可以通过http://example.com/static/访问它们,我想配置 nginx n仅从此 url 捕获这些文件。我已经阅读了http://www.nginxtips.com/how-to-enable-browser-cache-static-files-on-nginx/但是这里没有解释这个选项。我尝试了以下配置并重新启动了我的 nginx 服务器,但出现了错误。这是我的 sites-available/default配置文件。有什么问题?

server {
        listen  80;
        listen  443 ssl;
        server_name     www.example.com example.com;
        ssl_certificate /var/www/example/ssl/ssl.crt;
        ssl_certificate_key     /var/www/example/ssl/ssl.key;
        location /static (jpg|jpeg|png|gif|ico|css|js)$ {
                alias   /var/www/example/static;
                expires 3d;
                add_header Pragma public;
                add_header Cache-Control "public, must-revalidate, proxy-revalidate";

        }
        location /media  {
                alias  /var/www/example/media;
        }
        location / {
                proxy_pass      http://127.0.0.1:8000;
        }
}

这是 nginx 日志文件内容...

2014/03/07 13:02:28 [error] 25189#0: *22 open() "/etc/nginx/html/static/css/wait.css" failed (2: No such file or directory), client: 2.178.27.157, server: www.example.com, request: "GET /static/css/wait.css HTTP/1.1", host: "example.com", referrer: "http://example.com/"
2014/03/07 13:02:28 [error] 25189#0: *23 open() "/etc/nginx/html/static/img/infographi.png" failed (2: No such file or directory), client: 2.178.27.157, server: www.example.com, request: "GET /static/img/infographi.png HTTP/1.1", host: "example.com", referrer: "http://example.com/"
2014/03/07 13:02:29 [error] 25189#0: *23 open() "/etc/nginx/html/favicon.ico" failed (2: No such file or directory), client: 2.178.27.157, server: www.example.com, request: "GET /favicon.ico HTTP/1.1", host: "example.com"
2014/03/07 13:08:41 [emerg] 25220#0: invalid location modifier "/static" in /etc/nginx/sites-enabled/default:8
2014/03/07 13:08:41 [emerg] 25221#0: invalid location modifier "/static" in /etc/nginx/sites-enabled/default:8
2014/03/07 13:09:50 [emerg] 25255#0: invalid location modifier "/static" in /etc/nginx/sites-enabled/default:8
2014/03/07 13:09:50 [emerg] 25256#0: invalid location modifier "/static" in /etc/nginx/sites-enabled/default:8
ubuntu
  • 2 个回答
  • 5912 Views
Martin Hope
hamidfzm
Asked: 2014-02-06 12:10:10 +0800 CST

OpenVPN 客户端流量 [重复]

  • 0
这个问题在这里已经有了答案:
限制 OpenVPN 带宽 1 个回答
8年前关闭。

如何在 OpenVPN 中查看甚至控制客户端证书流量?可能吗?我正在编写一个客户端控制 Web 应用程序,但我一无所获。是否有任何脚本或命令?在 OpenVPN Access Server 中我见过这样的事情。

编辑:要清楚,我希望用户流量使用。

openvpn
  • 2 个回答
  • 650 Views
Martin Hope
hamidfzm
Asked: 2014-02-02 16:30:56 +0800 CST

如何查看已连接用户打开vpn服务器?

  • 80

我正在开发一个使用 Django 框架管理 OpenVPN 用户的网站。但我需要知道有没有办法从 OpenVPN 中提取活跃用户?我的服务器运行的是 Ubuntu 12.04。

openvpn
  • 8 个回答
  • 279196 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve