david euler 166df7d46b minor change | 6 tahun lalu | |
---|---|---|
templates | 6 tahun lalu | |
.gitignore | 6 tahun lalu | |
README.md | 6 tahun lalu | |
config.py | 6 tahun lalu | |
dump.sh | 6 tahun lalu | |
gunicorn.sh | 6 tahun lalu | |
links_title_dumper.py | 6 tahun lalu | |
requirements.txt | 6 tahun lalu | |
service.py | 6 tahun lalu | |
test.txt | 6 tahun lalu | |
url_util.py | 6 tahun lalu | |
wsgi.py | 6 tahun lalu |
1.URL对应的Title描述从网站的HTML内容中检索a标签得到; 输入是一个 <URL, Title> 列表
2.如果没有对应的Title,则根据URL后面的路径文件名从搜索引擎检索。
python links_title_dumper.py > links_json.py
location / {
try_files $uri $uri/ /index.php?$args @fetch;
}
location @fetch {
# 放错误页面的目录路径。
proxy_pass http://127.0.0.1:5000;
}
如上的配置,真实的URL不能正确传递到Flask服务端。 正确的配置:
location /{
autoindex off;
try_files $uri $uri/ @fetch;
}
# 定义错误页面码,如果出现相应的错误页面码,转发到那里。
error_page 404 403 = @fetch;
location @fetch {
# Redefine the header fields that NGINX sends to the upstream server
#the name and port of the NGINX server (Host $host)
proxy_set_header Host $host;
#the schema of the original client request, as in whether it was an http or an https request:
proxy_set_header X-Forwarded-Proto $scheme;
#the IP address of the user (X-Real-IP $remote_addr)
proxy_set_header X-Real-IP $remote_addr;
#the IP addresses of every server the client has been proxied through up to this point:
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Define the maximum file size on file uploads
client_max_body_size 5M;
# 放错误页面的目录路径。
proxy_pass http://127.0.0.1:5000;
}