Difference between revisions of "UWSGI"

From ArchWiki
Jump to: navigation, search
(Configuring)
(Nginx configuration)
Line 31: Line 31:
 
===== Nginx configuration =====
 
===== Nginx configuration =====
  
        location / {
+
location / {
            root  /usr/share/nginx/html;
+
    root  /usr/share/nginx/html;
            index  index.html index.htm;
+
    index  index.html index.htm;
            include uwsgi_params;
+
    include uwsgi_params;
            # uwsgi_pass unix:/var/run/uwsgi/helloworld.sock;
+
    # uwsgi_pass unix:/var/run/uwsgi/helloworld.sock;
            uwsgi_pass 127.0.0.1:3031;
+
    uwsgi_pass 127.0.0.1:3031;
        }
+
}
  
 
== See Also ==
 
== See Also ==
 
* [http://uwsgi-docs.readthedocs.org/en/latest/Nginx Official Documentation]
 
* [http://uwsgi-docs.readthedocs.org/en/latest/Nginx Official Documentation]
 
* [https://github.com/unbit/uwsgi-docs Nginx Github]
 
* [https://github.com/unbit/uwsgi-docs Nginx Github]

Revision as of 12:58, 2 August 2013


Installation

Install package uwsgi in the official repositories.

Starting Service

To enable the uwsgi service by default at start-up, run:

# systemctl enable uwsgi@helloworld.service

or

# systemctl enable uwsgi@helloworld.socket

Configuring

You can create a configuration by editing and putting that in /etc/uwsgi/. There is a build file shipped with the package located at /etc/uwsgi/archlinux.ini.

More details can be found here: [1].

Application configuration

The following is a simple example to get python support. You may need to install the uwsgi-plugin-python or uwsgi-plugin-python2 plugin from the community repository by pacman.

[uwsgi]
chdir = /srv/http/helloworld
module = helloworld
plugins = python
Nginx configuration
location / {
    root   /usr/share/nginx/html;
    index  index.html index.htm;
    include uwsgi_params;
    # uwsgi_pass unix:/var/run/uwsgi/helloworld.sock;
    uwsgi_pass 127.0.0.1:3031;
}

See Also