Django部署参考文章

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/huanhuanq1209/article/details/81053072

1、使用 Nginx 和 Gunicorn 部署 Django 博客https://www.zmrenwu.com/post/20/

2、Django笔记 —— MySQL安装https://www.tuicool.com/articles/ay6zMfV

3、Django+nginx+gunicorn部署流程(一)之nginx django gunicorn之间 的关系

https://blog.csdn.net/PANGHAIFEI/article/details/71424123

4、Django +nginx+gunicorn+阿里云部署笔记之git 与数据库迁移 +本地与服务器文件传输

https://blog.csdn.net/panghaifei/article/details/71192062

5、Nginx简单介绍:https://blog.csdn.net/laomoluhaitao/article/details/52333386

5.1、


rnhgth_saler.conf内容是:

server{
    listen 80;
    server_name 47.92.165.3;
    access_log /home/RunHangTech/logss/nginx.access.log;
    error_log /home/RunHangTech/logss/nginx.error.log;
    location / {
         proxy_pass http://127.0.0.1:8080;
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }

     # this prevents hidden files (beginning with a period) from being served

}

符号软连接到:

5.2、/etc/nginx/nginx.conf安装nginx后的nginx的默认配置

配置文件的详解:https://www.cnblogs.com/Joans/p/4386556.html

user www-data;
#user root;
worker_processes 4;
#pid /run/nginx.pid;

events {
	worker_connections 768;
	# multi_accept on;
}

http {

	##
	# Basic Settings
	##

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	# server_tokens off;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	include /etc/nginx/mime.types;
	default_type application/octet-stream;
        
	##
	# Logging Settings
	##

	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log;

	##
	# Gzip Settings
	##

	gzip on;
	gzip_disable "msie6";

	# gzip_vary on;
	# gzip_proxied any;
	# gzip_comp_level 6;
	# gzip_buffers 16 8k;
	# gzip_http_version 1.1;
	# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

	##
	# nginx-naxsi config
	##
	# Uncomment it if you installed nginx-naxsi
	##

	#include /etc/nginx/naxsi_core.rules;

	##
	# nginx-passenger config
	##
	# Uncomment it if you installed nginx-passenger
	##
	
	#passenger_root /usr;
	#passenger_ruby /usr/bin/ruby;

	##
	# Virtual Host Configs
	##
        
	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
}


#mail {
#	# See sample authentication script at:
#	# http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
# 
#	# auth_http localhost/auth.php;
#	# pop3_capabilities "TOP" "USER";
#	# imap_capabilities "IMAP4rev1" "UIDPLUS";
# 
#	server {
#		listen     localhost:110;
#		protocol   pop3;
#		proxy      on;
#	}
# 
#	server {
#		listen     localhost:143;
#		protocol   imap;
#		proxy      on;
#	}
#}

5.3、


猜你喜欢

转载自blog.csdn.net/huanhuanq1209/article/details/81053072
今日推荐