Forum: NGINX redirect joomla url to dns name

Posted by srinivasa.nallapati (Guest)
on 2012-12-04 10:11
(Received via mailing list)
HI All ,

my joomla application is running 192.168.1.203 system in httpd
sever,Operating system Fedora 14.
URL : http://192.168.1.203/joomla

I want redirect this url with some good name like , 
srinivas.walkingtree.in
(it was created by dns server for ip 192.168.1.150).

my nginx,conf file .(nginx server = 192.168.1.150)

server {
  listen 192.168.1.150:80;
  server_name  srinivas.walkingtree.in;
 location / {
    proxy_set_header X-Forwarded-Host $host;
   proxy_set_header X-Forwarded-Server $host;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass  http://192.168.1.203/joomla;
  }
}


At first  , When i access http://srinivas.walkingtree.in . This is 
working .
If i click on any button (products), it is redirecting to
http://192.168.1.203/joomla/products .

Please help me .

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,233546,233546#msg-233546
Posted by Francis Daly (Guest)
on 2012-12-04 13:21
(Received via mailing list)
On Tue, Dec 04, 2012 at 04:10:51AM -0500, srinivasa.nallapati wrote:

Hi there,

>   server_name  srinivas.walkingtree.in;
>  location / {
>     proxy_set_header X-Forwarded-Host $host;
>    proxy_set_header X-Forwarded-Server $host;
>    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
>     proxy_pass  http://192.168.1.203/joomla;
>   }

> At first  , When i access http://srinivas.walkingtree.in . This is working .
> If i click on any button (products), it is redirecting to
> http://192.168.1.203/joomla/products .

http://nginx.org/r/proxy_set_header

Most likely you can get it to do what you want by adding

  proxy_set_header Host $host;

beside the other proxy_set_header lines.

  f
--
Francis Daly        francis@daoine.org
Posted by srinivasa.nallapati (Guest)
on 2012-12-04 13:35
(Received via mailing list)
Thanks ,

Now  i used the follow thing ,

server {
  listen 192.168.1.150:80;
  server_name  srinivas.walkingtree.in;
location / {

    proxy_pass  http://192.168.1.203/joomla/;
    proxy_redirect     off;

    proxy_set_header   Host             $host;
    proxy_set_header   X-Real-IP        $remote_addr;
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

    client_max_body_size       10m;
    client_body_buffer_size    128k;

    proxy_connect_timeout      90;
    proxy_send_timeout         90;
    proxy_read_timeout         90;

    proxy_buffer_size          4k;
    proxy_buffers              4 32k;
    proxy_busy_buffers_size    64k;
    proxy_temp_file_write_size 64k;
}
}

when i click on products ,
http://srinivas.walkingtree.in/joomla/index.php/products

error:

Not Found
The requested URL /joomla/joomla/index.php/products was not found on 
this
server.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,233546,233559#msg-233559
Posted by Antonio P.P. Almeida (Guest)
on 2012-12-04 13:41
(Received via mailing list)
>     proxy_redirect     off;
>     proxy_read_timeout         90;
>
>     proxy_buffer_size          4k;
>     proxy_buffers              4 32k;
>     proxy_busy_buffers_size    64k;
>     proxy_temp_file_write_size 64k;
> }
> }
>
> when i click on products ,
> http://srinivas.walkingtree.in/joomla/index.php/products

Try: http://srinivas.walkingtree.in/index.php/products

--appa
Posted by srinivasa.nallapati (Guest)
on 2012-12-04 13:49
(Received via mailing list)
Thanks ,

Now the page is loading but ,No images ,No colors and no  css etc..

it is coming just like basic index page .

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,233546,233561#msg-233561
Posted by srinivasa.nallapati (Guest)
on 2012-12-04 14:17
(Received via mailing list)
srinivasa.nallapati Wrote:
-------------------------------------------------------
> Thanks ,
>
> Now the page is loading but ,No images ,No colors and no  css etc..
>
> it is coming just like basic index page .

in developer tools , the below error is coming

GET
http://demojoomla.walkingtree.in/bapoc/components/...
404 (Not Found) /:12
GET
http://demojoomla.walkingtree.in/bapoc/components/...
404 (Not Found) /:13
GET 
http://demojoomla.walkingtree.in/bapoc/media/syste...
404 (Not Found) /:14
GET http://demojoomla.walkingtree.in/bapoc/media/syste... 404 
(Not
Found) /:14
GET http://demojoomla.walkingtree.in/bapoc/media/syste... 
404
(Not Found) /:14
GE

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,233546,233564#msg-233564
Posted by srinivasa.nallapati (Guest)
on 2012-12-04 14:21
(Received via mailing list)
srinivasa.nallapati Wrote:
-------------------------------------------------------
> srinivasa.nallapati Wrote:
> -------------------------------------------------------
> > Thanks ,
> >
> > Now the page is loading but ,No images ,No colors and no  css etc..
> >
> > it is coming just like basic index page .
>
sorry for wrong information ,

 in developer tools , the below error is coming

 GET
http://srinivas.walkingtree.in/joomla/components/c...
404 (Not Found) /:12

it is calling joomla after dns name

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,233546,233565#msg-233565
Posted by Francis Daly (Guest)
on 2012-12-04 16:12
(Received via mailing list)
On Tue, Dec 04, 2012 at 08:20:37AM -0500, srinivasa.nallapati wrote:

Hi there,

>  GET
> 
http://srinivas.walkingtree.in/joomla/components/c...
> 404 (Not Found) /:12

What file, on what server, does that "facebox.css" correspond to?

If you issue the request with "curl -i", can you see whether the 404
message came from nginx or from something else?

Untested, but I suspect that you want either

  location / {
    proxy_pass http://192.168.1.203;
    # the rest of the config goes here
  }

or

  location /joomla/ {
    proxy_pass http://192.168.1.203/joomla/;
    # the rest of the config goes here
  }
  location = / {
    return 301 /joomla/;
  }

to achieve what you want -- but it's not yet clear exactly what you 
want.

http://nginx.org/r/proxy_pass for details.

  f
--
Francis Daly        francis@daoine.org
Posted by srinivasa.nallapati (Guest)
on 2012-12-04 16:47
(Received via mailing list)
Sorry !

Actually i am running joomla in httpd server . URL :
http://192.168.1.203/joomla/;

I want acces this url with name like srinivas.walkingtree.in
When i browse srinivas.walkingtree.in .it is working ,if i click any 
button
in this appllication , it is redirecting to again
http://192.168.1.203/joomla/

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,233546,233575#msg-233575
Posted by Francis Daly (Guest)
on 2012-12-04 19:18
(Received via mailing list)
On Tue, Dec 04, 2012 at 10:46:58AM -0500, srinivasa.nallapati wrote:

Hi there,

> Actually i am running joomla in httpd server . URL :
> http://192.168.1.203/joomla/;
>
> I want acces this url with name like srinivas.walkingtree.in

If you are happy for the user to see

  http://srinivas.walkingtree.in/joomla/

and what was suggested does not work for you, then please be specific
about what exact configuration you used, what url you tried to access,
what response you got, and what response you expected to get.

Ideally, copy-paste the "curl -i" commands which show the problem.

If you do not want the user to see 
http://srinivas.walkingtree.in/joomla/,
then some other changes will be needed. Possibly using proxy_redirect
(http://nginx.org/r/proxy_redirect) will help, or possibly some
configuration on the joomla side will be needed to allow it to be hidden
in a subdirectory behind a reverse proxy.

> When i browse srinivas.walkingtree.in .it is working ,if i click any button
> in this appllication , it is redirecting to again
> http://192.168.1.203/joomla/

The first line there is:

  curl -i http://srinivas.walkingtree.in/

and you can compare what you get with what you expect.

The second line is something else. Instead of clicking on a button,
right-click and "copy link location" or "copy shortcut" or do whatever
your browser needs to store the url you are about to access; then paste
that url into the command line

  curl -i <that url>

and again you can compare what you get with what you expect. For 
example,
you probably don't expect to see the address 192.168.1.203 anywhere in
the response.

Unless you show exactly what you do, what you see, and what you expect
to see; it is difficult for others to offer useful help.

  f
--
Francis Daly        francis@daoine.org
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.