Error while trying to redirect HTML link from "ServerA-Apache" to "ServerB-Django app using Nginx and gunico".
Server A-Apache
html snipped: href="http://www.DOMAIN.com/contacts">Django Admin
vim /etc/httpd/conf.d/httpd-vhosts.conf
<VirtualHost *:80>
ServerName contacts.DOMAIN.com
ProxyPass /contacts http://IP-B
ProxyPassReverse /contacts http://IP-B
</VirtualHost>
vim /etc/httpd/conf.d/mod_proxy.conf
ProxyPass /contacts http://IP-B
ProxyPassReverse /contacts http://IP-B
Server B-Nginx, Gunico
vim /etc/nginx/sites-available/contacts
server {
listen 80;
server_name IP-B;
location /static/ {
autoindex on;
alias /opt/myenv/contactsproj/static/;
}
location / {
proxy_pass http://IP-B:8000;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
}
}
Gunico gunico contactsproj.wsgi --bind 0.0.0.0:8000
urls.py
urlpattes = [
url(r'^admin/', admin.site.urls),
url(r'^contacts/', admin.site.urls),
url(r'^$', admin.site.urls),
]
I'd like when I hit the the html snipped above (server-A domain) go to server B and load Django admin page.
Bear in mind the configuration above, I got: The requested URL /admin/login/ was not found on this server.
Could you please help me on it?
