小编thm*_*ms0的帖子

nginx的http_sub_module/sub_filter和反向代理无法正常工作

我试图反向代理我的网站并修改内容.为此,我使用sub_filter编译了nginx.它现在接受sub_filter指令,但它不能以某种方式工作.

server {
    listen       8080;
    server_name  www.xxx.com;

    access_log  /var/log/nginx/www.goparts.access.log  main;
    error_log  /var/log/nginx/www.goparts.error.log;
    root   /usr/share/nginx/html;
    index  index.html index.htm;

    ## send request back to apache1 ##
    location / {
       sub_filter <title> '<title>test</title>';
 sub_filter_once on;


     proxy_pass  http://www.google.fr;
     proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
     proxy_redirect off;
     proxy_buffering off;
     proxy_set_header        Host            $host;
     proxy_set_header        X-Real-IP       $remote_addr;
     proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;

   }
}
Run Code Online (Sandbox Code Playgroud)

请帮我

proxy reverse nginx inject

10
推荐指数
1
解决办法
1万
查看次数

uWSGI + Django + Python:没有名为uwsgi的模块

我正在尝试为我的Django项目设置uwsgi.它运行良好

./manage.py runserver 0.0.0.0:9010
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试

 uwsgi --http :9010 --chdir /home/user/appname --module wsgi --wsgi-file /home/user/appname/appname/wsgi.py 
Run Code Online (Sandbox Code Playgroud)

我明白了

ImportError: No module named wsgi
Run Code Online (Sandbox Code Playgroud)

我做错了什么?

这是完整的日志:

uWSGI http bound on :9010 fd 4
spawned uWSGI http 1 (pid: 1900)
uwsgi socket 0 bound to TCP address 127.0.0.1:42684 (port auto-assigned) fd 3
Python version: 2.7.9 (default, Mar  1 2015, 13:01:26)  [GCC 4.9.2]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x1c17310
your server socket listen …
Run Code Online (Sandbox Code Playgroud)

python django uwsgi

3
推荐指数
1
解决办法
5555
查看次数

使用lsyncd同步MULTIPLE目录

我使用lsyncd同步一个目录,这是我的/etc/lsyncd/lsyncd.conf.lua:

sync
 {
     default.rsyncssh,
     source="/home/user/sync/",
     host="redacted",
     targetdir="/home/user/sync"
 }
Run Code Online (Sandbox Code Playgroud)

我尝试添加两个同步块,但只有第一个正在工作.我该怎么办 ?

问候,

linux bash lua rsync

2
推荐指数
1
解决办法
4364
查看次数

标签 统计

bash ×1

django ×1

inject ×1

linux ×1

lua ×1

nginx ×1

proxy ×1

python ×1

reverse ×1

rsync ×1

uwsgi ×1