Nginx.conf now lost access connection

Hi. I am new to nginx. I use it for testing only - maybe a small live
production later.

Here are the config.

Ubuntu 8.04
Nginx 0.5.33
PHP + MYSQL + CGI/FASTCGI

Basically everything worked out very fine and smooth until I decided to
modify my nginx.conf because I want to run Drupal.

As you all know, Nginx doesn’t come with mod_rewrite rules by default
unless you modify it. I am totally new to Nginx and I found so many
threads so I started to change the configuration.

The attachment is the final result what I did to nginx.conf

This is the reference I followed - I took pieces from each comment…

As you see from my config, I have already enabled port 80 from my router
setting. I have already enabled every needed port.
I am only doing this locally - so I didn’t domain. Just local IP
192.168.1.101

At the moment, I just want to re-connect my server connection back. I
type 192.168.1.101:

#######

Unable to connect

Firefox can’t establish a connection to the server at

192.168.1.101.
#######

This is what I received from the browser (the desktop connected to the
same router as the server connected to the same router as well).

Please guide me through the troubleshoot. Thank you. I am indeed need
this up back again as soon as possible…

On Sat, 2009-08-22 at 00:53 +0200, John Johnny wrote:

At the moment, I just want to re-connect my server connection back. I
type 192.168.1.101:

#######

Unable to connect

Firefox can’t establish a connection to the server at

192.168.1.101.
#######

You have an error in your config that prevents Nginx from starting:

-listen 80 #REPLACE THIS FOR YOUR NEED
+listen 80; #REPLACE THIS FOR YOUR NEED

You need to terminate lines with a semicolon.

For future reference, your Nginx error log would have undoubtedly told
you this.

Cliff

John Johnny wrote:

Cliff W. wrote:

On Sat, 2009-08-22 at 00:53 +0200, John Johnny wrote:

At the moment, I just want to re-connect my server connection back. I
type 192.168.1.101:

#######

Unable to connect

Firefox can’t establish a connection to the server at

192.168.1.101.
#######

You have an error in your config that prevents Nginx from starting:

-listen 80 #REPLACE THIS FOR YOUR NEED
+listen 80; #REPLACE THIS FOR YOUR NEED

You need to terminate lines with a semicolon.

For future reference, your Nginx error log would have undoubtedly told
you this.

Cliff

Hi Cliff,
Thank you for your reply. I added ; back and still no luck. I decided to
take a look at /var/log/nginx/error.log (the attachment) but I found
nothing related to this. Apparently the log didn’t save the most recent
log…

I typed 192.168.1.101 again and still no luck. Then I decided to change
the server_name to my static ip (I use cable)

So I saved 69.86.175.232 and still no luck (after restarting the
server…)

Even with 69.86.175.232:101 not working…

It seems like there is something wrong with the server part…

After running around, I found a better way to debug.
Everytime I do stop start the nginx application, it showed some errors.
By trying to fix each error, I finally get to connect to my server in my
browser. But another problem appeared:

No input file specified.

The last error I received was this "include
/etc/nginx/sites-enabled/default:7 unknown directive “server”.

I checked this in nignix.conf - it was the last line (check the
attachment in the first post). I then headed to
/etc/nginx/sites-enabled/default.

I found out that it was the default setting for the nginx.conf. I
removed include /etc/nginx/sites-enabled/* from nginx.conf and I can
connected to the server again.

Yet, the No input file specified appeared and I think it has something
to do with the fastcgi_setting in my current nginx.conf.

Please a take look and tell me what’s wrong…

okay sorry for the spamming LOL

so I finally got most of the things worked.
I can do 192.168.1.101/test.html

I compare the etc/nginx/nginx.conf and
/etc/nginx/sites-enabled/default

well pretty much i can say it is the problem with the fastcgi…
i cannot run any php page - or will return no file spcieficed…

i promised this is the last message until i receive some answer :slight_smile:

please download the attachment in this post…

On Sat, Aug 22, 2009 at 12:42 PM, John Johnny[email protected]
wrote:

fastcgi_param SCRIPT_FLENAME
/var/www/nginx-default/drupal$fastcgi_script_name;

you’ve got typo there - should be SCRIPT_FILENAME

Edho P Arief wrote:

On Sat, Aug 22, 2009 at 12:42 PM, John Johnny[email protected]
wrote:

fastcgi_param SCRIPT_FLENAME
/var/www/nginx-default/drupal$fastcgi_script_name;

you’ve got typo there - should be SCRIPT_FILENAME

LMAO i am laughing at myself so hard.

I was like checking it 20+ times and still couldn’t catch that
spelling…

thank you very much!

Cliff W. wrote:

On Sat, 2009-08-22 at 00:53 +0200, John Johnny wrote:

At the moment, I just want to re-connect my server connection back. I
type 192.168.1.101:

#######

Unable to connect

Firefox can’t establish a connection to the server at

192.168.1.101.
#######

You have an error in your config that prevents Nginx from starting:

-listen 80 #REPLACE THIS FOR YOUR NEED
+listen 80; #REPLACE THIS FOR YOUR NEED

You need to terminate lines with a semicolon.

For future reference, your Nginx error log would have undoubtedly told
you this.

Cliff

Hi Cliff,
Thank you for your reply. I added ; back and still no luck. I decided to
take a look at /var/log/nginx/error.log (the attachment) but I found
nothing related to this. Apparently the log didn’t save the most recent
log…

I typed 192.168.1.101 again and still no luck. Then I decided to change
the server_name to my static ip (I use cable)

So I saved 69.86.175.232 and still no luck (after restarting the
server…)

Even with 69.86.175.232:101 not working…

It seems like there is something wrong with the server part…