# WebDriver and Nginx

**URL:** <https://www.ruby-forum.com/t/webdriver-and-nginx/212047>\
**Category:** NGINX\
**Created:** [September 20, 2011, 8:47pm UTC](https://www.ruby-forum.com/t/webdriver-and-nginx/212047 "2011-09-20T20:47:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [September 20, 2011, 8:47pm UTC](https://www.ruby-forum.com/t/webdriver-and-nginx/212047/1 "2011-09-20T20:47:58Z")

</div>

Has anyone tried using nginx and webdriver together? Before I used nginx  
as a reverse proxy, I never had any problems, but now I can’t get the  
browser being controlled by webdriver to get webpages.

An example from the python shell:

> > > import selenium  
> > > from selenium import webdriver  
> > > profile = webdriver.FirefoxProfile()  
> > > profile.set\_preference(“network.proxy.type”, 1)  
> > > profile.set\_preference(“network.proxy.http”, “127.0.0.1”)  
> > > profile.set\_preference(“network.proxy.http\_port”, “80”)  
> > > driver = webdriver.Firefox(firefox\_profile=profile)  
> > > driver.get(“[http://www.google.com](http://www.google.com)”)

And then nothing happens.

Since it works when nginx isn’t running, I’m guessing the problem is  
from the nginx side. Has anyone experienced something similar?

Posted at Nginx Forum:

> **[WebDriver and Nginx](https://forum.nginx.org/read.php?2,215454,215454#msg-215454)**
>
> Has anyone tried using nginx and webdriver together? Before I used nginx as a reverse proxy, I never had any problems, but now I can't get the browser being controlled by webdriver to get webpages. An example from the python shell: \>\>\>...

---

<div class="post-metadata">

**Author:** ![ynasser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/fbc32d/32.png) [@ynasser](https://www.ruby-forum.com/u/ynasser)\
**Post date:** [September 20, 2011, 8:55pm UTC](https://www.ruby-forum.com/t/webdriver-and-nginx/212047/2 "2011-09-20T20:55:24Z")

</div>

Hello!

On Tue, Sep 20, 2011 at 02:47:26PM -0400, ynasser wrote:

> > > > profile.set\_preference(“network.proxy.http”, “127.0.0.1”)  
> > > > profile.set\_preference(“network.proxy.http\_port”, “80”)  
> > > > driver = webdriver.Firefox(firefox\_profile=profile)  
> > > > driver.get(“[http://www.google.com](http://www.google.com)”)
> 
> And then nothing happens.
> 
> Since it works when nginx isn’t running, I’m guessing the problem is  
> from the nginx side. Has anyone experienced something similar?

Since I really doubt [www.google.com](http://www.google.com) running nginx, I suppose you  
are using nginx on 127.0.0.1:80, right?

The problem is that nginx isn’t a forward proxy and never was.

Maxim D.

---

<div class="post-metadata">

**Author:** ![ynasser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/fbc32d/32.png) [@ynasser](https://www.ruby-forum.com/u/ynasser)\
**Post date:** [September 21, 2011, 12:00am UTC](https://www.ruby-forum.com/t/webdriver-and-nginx/212047/3 "2011-09-21T00:00:18Z")

</div>

The problem isn’t that it can’t access [google.com](http://google.com) (or whatever url),  
but that it won’t even try. If my code was successful, an error  
message should be displayed in the browser saying that it can’t access  
google because nginx is running, or something along those lines (so,  
exactly what you said).

The problem is that I can’t control the instance of the browser once  
it’s opened. It won’t respond to any navigation requests and I think  
that nginx is somehow interfering, but I have no idea how. It doesn’t  
make much sense that a web server is interfering with the ability to  
control a web browser via software 😕
