AJP from apache to nginx

姚伟斌 nbubingo at gmail.com
Mon Jun 25 09:19:56 UTC 2012


why you use two proxy modules? You should choose one. The port 8009
normally is the AJP connector, you should use it with ajp module. Or
you can use the port 80 with http proxy module.

Thanks.

2012/6/25 karolis <nginx-forum at nginx.us>:
> Hi everyone,
>
> first of all i'm completely new user of nginx. I want to move from
> apache-tomcat to nginx-tomcat, but i'm having big problems with nginx
> ajp module and how to use it. Any help would be greatly appreciated!
>
> Here are my apache httpd-vhosts.conf:
>
> NameVirtualHost *:80
> NameVirtualHost *:443
>
> <VirtualHost *:80>
>        ServerAdmin webmaster at localhost
>        ServerName alis.am.lt
>        ProxyRequests off
>        ProxyPreserveHost on
>
>        <Proxy *>
>                Order deny,allow
>                Allow from all
>        </Proxy>
>
>        ProxyPass /AlisL09Service
> http://10.255.6.120:8080/AlisL09Service/
>        ProxyPassReverse /AlisL09Service
> http://10.255.6.120:8080/AlisL09Service/
>
>        ProxyPass /gis/geoserver/web !
>        ProxyPass /gis http://10.255.5.140:8080
>        ProxyPassReverse /gis http://10.255.5.140:8080
>
>        ProxyPass / ajp://localhost:8009/
>        ProxyPassReverse / ajp://localhost:8009/
>        ProxyPassReverse / http://localhost:8009/
>        ProxyPassReverseCookiePath /localhost /localhost/
>
> </VirtualHost>
> <VirtualHost *:443>
>        ServerAdmin webmaster at localhost
>        ServerName alis.am.lt
>
>        ProxyRequests off
>        ProxyPreserveHost on
>
>        <Proxy *>
>                Order deny,allow
>                Allow from all
>        </Proxy>
>
>        ProxyPass /gis/geoserver/web !
>        ProxyPass /gis http://10.255.5.140:8080
>        ProxyPassReverse /gis http://10.255.5.140:8080
>
>        ProxyPass / ajp://localhost:8009/
>        ProxyPassReverse / ajp://localhost:8009/
>        ProxyPassReverse / http://localhost:8009/
>        ProxyPassReverseCookiePath /localhost /localhost/
>
>        SSLEngine on
>        SSLProtocol all
>        SSLCertificateFile
> /home/dts/certificates/alis.publicsite.primary.cert.p7b
>        SSLCertificateKeyFile
> /home/dts/certificates/alis.am.lt_privateKeyNoPass.key
>        SSLCertificateChainFile
> /home/dts/certificates/alis.publicsite.intermediate.cert.p7b
>
> </VirtualHost>
> SSLPassPhraseDialog builtin
>
>
> And here's what i have so far in my nginx.conf:
>
> user              nginx;
> worker_processes  8;
>
> error_log  logs/error.log;
> pid        logs/nginx.pid;
>
> events {
>    worker_connections  8192;
> }
>
> http {
> upstream www_serveriai  {
> server 10.255.7.120:443;
> }
> upstream www_serveriai_80  {
> server 10.255.7.120:80;
> }
>    include       /usr/local/nginx/conf/mime.types;
>    default_type  application/octet-stream;
>
>    log_format  main  '$remote_addr - $remote_user [$time_local]
> "$request" '
>                      '$status $body_bytes_sent "$http_referer" '
>                      '"$http_user_agent" "$http_x_forwarded_for"';
>
>    access_log  /usr/local/nginx/logs/access.log  main;
>
>    sendfile        on;
>    keepalive_timeout  65;
>
>  server {
>      listen 80;
>      server_name alis.am.lt;
>      location / {
>        #proxy_pass ajp://localhost:8009/;
>        proxy_pass http://localhost:8009/;
>        ajp_keep_conn on;
>        ajp_pass www_serveriai_80;
>      }
>
> }
> }
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,227843,227843#msg-227843
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list