Je pense qu'il n'y a rien de mal à exécuter quelques instances paster, mais vous devriez envisager d'utiliser FastCGI (ou wsgi) et Virtual Hosts, car il est plus approprié pour "environnement de production". Exemple avec FastCGI:
pid /var/run/nginx.pid;
user www;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include /etc/mime.types;
default_type application/octet-stream;
sendfile on;
gzip on;
keepalive_timeout 65;
# First site
server {
listen *:443;
server_name first.example.com;
ssl on;
ssl_certificate /etc/www/cert.pem;
ssl_certificate_key /etc/www/key.pem;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1;
location/{
fastcgi_pass 127.0.0.1:9000;
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_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;
fastcgi_param HTTPS on;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
}
access_log /var/log/first.access.log main;
error_log /var/log/first.error.log;
}
# Second site
server {
listen *:443;
server_name second.example.com;
ssl on;
ssl_certificate /etc/www/cert1.pem;
ssl_certificate_key /etc/www/key1.pem;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1;
location/{
fastcgi_pass 127.0.0.1:9001;
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_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;
fastcgi_param HTTPS on;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
}
access_log /var/log/second.access.log main;
error_log /var/log/second.error.log;
}
}
Maintenant, vous avez des sites:
first.example.com -> localhost:9000
second.example.com -> localhost:9001
Vous pouvez également définir IP pour "écouter", par exemple:
listen 192.168.1.1:443;
listen 192.168.1.2:443;
afin que vous puissiez utiliser IP au lieu du nom DNS.
Pour l'application Pylons vous devez modifier la configuration de FastCGI:
[server:main]
use = egg:Flup#fcgi_thread
host = 127.0.0.1
port = 9000
pour premier hôte, et pour la deuxième:
[server:main]
use = egg:Flup#fcgi_thread
host = 127.0.0.1
port = 9001
Hope this helps.