[Django] deploy with fastcgi

Source: Internet
Author: User

[Django] deploy with fastcgi

The django official team has begun to deploy the django application with fastcgi. As a user who has used it before, I should post a configuration to commemorate it.

Under Project
#! /bin/shcase   "$@"   in    start)        python manage.py runfcgi host=127.0.0.1 port=8400        ;;    stop)        kill -9 `ps aux|grep runfcgi|grep 8400|awk '{print $2}'|xargs`        ;;    restart)        kill -9 `ps aux|grep runfcgi|grep 8400|awk '{print $2}'|xargs`        sleep 1        python manage.py runfcgi host=127.0.0.1 port=8400        ;;    *)        echo 'unknown arguments'        exit 1        ;;esac
Nginx Configuration
server { listen 80; server_name 127.0.0.1; access_log /var/log/nginx/vsite.access_log; error_log /var/log/nginx/vsite.error_log; location ^~/media { alias /data/test/vsite/staticfiles; } location ^~/upload { alias /data/test/vsite/uploadfiles; } location ^~/static { alias /data/test/vsite/staticfiles; } location / { # host and port to fastcgi server fastcgi_pass 127.0.0.1:8401; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param QUERY_STRING $query_string; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_pass_header Authorization; fastcgi_intercept_errors off; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; fastcgi_param SERVER_PROTOCOL $server_protocol; }}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.