国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術(shù)文章
文章詳情頁

nginx+uwsgi部署django,8000端口正常,80端口404

瀏覽:75日期:2024-10-15 10:47:17

問題描述

按照教程用nginx+uwsgi部署django項目,監(jiān)聽8000端口正常,80端口訪問時顯示404 not found.django項目目錄為/home/wu/Documents/env/myblog項目文件夾下文檔結(jié)構(gòu)

nginx+uwsgi部署django,8000端口正常,80端口404

myblog_nginx.conf文件

# mysite_nginx.conf# the upstream component nginx needs to connect toupstream django { server unix:///home/wu/Documents/env/myblog/mysite.sock; # for a file socket #server 127.0.0.1:8001; # for a web port socket (we'll use this first)}# configuration of the serverserver { # the port your site will be served on listen 80; # the domain name it will serve for server_name .example.com; # substitute your machine's IP address or FQDN charset utf-8; # max upload size client_max_body_size 75M; # adjust to taste # Django media location /media {alias /home/wu/Documents/env/myblog/media; # your Django project's media files - amend as required } location /static {alias /home/wu/Documents/env/myblog/static; # your Django project's static files - amend as required } # Finally, send all non-media requests to the Django server. location / { root /home/wu/Documents/env/myblog;uwsgi_pass django;include /home/wu/Documents/env/myblog/uwsgi_params; # the uwsgi_params file you installed }}

mysite_uwsgi.ini文件

# mysite_uwsgi.ini file[uwsgi]# Django-related settings# the base directory (full path)chdir = /home/wu/Documents/env/myblog# Django's wsgi filemodule = myblog.wsgi# the virtualenv (full path)home = /home/wu/Documents/env# process-related settings# mastermaster = true# maximum number of worker processesprocesses = 10# the socket (use the full path to be safesocket = /home/wu/Documents/env/myblog/mysite.sock# ... with appropriate permissions - may be neededchmod-socket = 666# clear environment on exitvacuum = true

myblog_nginx.conf文件中改為8000端口時沒問題

nginx+uwsgi部署django,8000端口正常,80端口404

改為80端口后,raload,restart nginx,uwsgi --ini mysite_uwsgi.ini,然后訪問

nginx+uwsgi部署django,8000端口正常,80端口404

求指點,搞了好久都沒解決這個問題,感激不盡!!!

問題解答

回答1:

是不是你其他地方配置了

server { listen 80; xxx}#導致沒進入你的server塊,看下nginx.conf,或者其他虛擬主機的配置文件。另外你的server { /*這個去掉吧,或者你可以測試重復,host配置一個xxx.com, 這邊也配置為xxx.com,相比于listen 80,會優(yōu)先進入這個server塊。*/ #server_name .example.com;}

回答2:

8000 端口顯示的那個頁面是 Django 自帶的測試頁,在 80 端口部署的時候應該不會出現(xiàn),建議你自己寫個頁面部署到 80 端口試試

相關(guān)文章:
主站蜘蛛池模板: 精品在线观看国产 | 亚洲成人中文 | 亚洲第三区 | 亚洲综合网在线 | 91av国产在线 | xxxxx日本59 | 亚洲视频国产精品 | 亚洲精彩| 韩国一级毛片在线观看 | 欧美一线高本道高清在线 | 九九九国产在线 | 在线免费观看亚洲 | 免费一看一级毛片全播放 | 中文字幕天堂久久精品 | 欧美激情亚洲一区中文字幕 | 亚洲天堂手机在线 | 亚洲性在线 | 国产成人亚洲欧美三区综合 | 欧洲一级毛片 | 米奇888在线播放欧美 | 国产成人亚洲精品无广告 | 久久精品久久精品久久精品 | 永久黄网站色视频免费网站 | 一级在线视频 | 一级做a爰 | 久久国产成人福利播放 | 免费又黄又爽又猛大片午夜 | 欧美视频一二三区 | 日产毛片 | 国产精品久久自在自线观看 | 欧美日韩国产片 | 伊人网五月天 | 高清一区在线 | 成人免费视频网 | 九九九精品视频免费 | 2022国产精品手机在线观看 | 亚洲精品综合在线 | 欧美成人精品大片免费流量 | 亚洲 自拍 另类 欧美 综合 | 日本美女高清在线观看免费 | 99精品视频在线观看免费 |