Proxy Error - Como converter uma configuração Nginx em Apache?

0

Como posso converter a configuração nginx abaixo em apache?

http {
    server {
        listen          8000;
        server_name     127.0.0.1;
        location / {
            proxy_pass http://unix:/run/gunicorn/socket;
        }
    }
}

Isso é o que eu fiz:

sudo nano /etc/apache2/sites-available/000-default.conf

<VirtualHost *:8000>
    ServerName localhost
    ProxyPass / http://unix:/run/gunicorn/socket/
</VirtualHost>

Então:

$ sudo a2enmod proxy_http

$ sudo systemctl restart apache2
$ systemctl status apache2
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Fri 2017-05-19 22:10:40 BST; 3s ago
  Process: 15817 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
  Process: 15831 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 15835 (apache2)
    Tasks: 6 (limit: 4915)
   CGroup: /system.slice/apache2.service
           ├─15835 /usr/sbin/apache2 -k start
           ├─15836 /usr/sbin/apache2 -k start
           ├─15837 /usr/sbin/apache2 -k start
           ├─15838 /usr/sbin/apache2 -k start
           ├─15839 /usr/sbin/apache2 -k start
           └─15840 /usr/sbin/apache2 -k start

May 19 22:10:40 lau-desktop systemd[1]: Starting The Apache HTTP Server...
May 19 22:10:40 lau-desktop systemd[1]: Started The Apache HTTP Server.

Não parece nenhum erro. Mas no meu navegador, no link :

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /.

Reason: DNS lookup failure for: unix:

Apache/2.4.25 (Ubuntu) Server at 127.0.0.1 Port 8000

Alguma idéia?

    
por laukok 19.05.2017 / 23:01

0 respostas