My server is as server { server_name .domain.com; listen 80; root /home/domain.com; index index.html index.php; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /opt/nginx/conf/fastcgi_params; } } You mean to add another location as location ~ \.py$ {by etrader - Nginx Mailing List - English
The instruction given on http://wiki.nginx.org/PythonFlup is to install nginx supporting python. But I have a working Nginx with php-fpm supporting PHP. Now I want to add support of python too. Thus, my config is slightly different. I successfully installed Python 2.6, Django and python-flup. Everything went good, but python does not work on web (when visiting test.py, it downloads the file insteaby etrader - Nginx Mailing List - English
As far as I know, Nginx does not support variable in error_log.by etrader - Nginx Mailing List - English
Thanks Reinis! It worked like a charm. But I have another problem (maybe I should to start a new thread). It lists the access of my own server to images. When someone visits an html page, an addition to this trick, a line is added with my server IP for reading the image within the html page. Since I just want the track of my traffic, this is useless to have it as my server has loaded the images.by etrader - Nginx Mailing List - English
Isn't it possible to use multiple access_log to split the access log to traffic and 404 logs ? Or probably writing 404 logs to error_log.by etrader - Nginx Mailing List - English
You mean to read only 200 requests in ssh or something like that? I am looking for a way to avoid writing 404 requests in access log file to keep the file tidy.by etrader - Nginx Mailing List - English
My access log is full of 404 logs for images not found; thus, it is difficult to find real 200 successful visits. The lines include ... GET /css/img/calendar.png HTTP/1.1" 404 31 "http://mydomain.com.page.html ...by etrader - Nginx Mailing List - English
Thanks locojohn! It perfectly worked :)by etrader - Nginx Mailing List - English
I have a php script which takes too long to be executed (a form for uploading large files). Upong running this I get "504 Gateway Time-out" error. Since I do not want to update php.ini for the whole server, I put set_time_limit(0); at the top of my php script; but still I get the same time-out error. What is the problem? I'm on Nginx 1.0.4.by etrader - Nginx Mailing List - English
Thanks Jim, Yes, I run nginx as www-data; I just meant creating files and folders by root. My own PC run on Ubuntu; thus I connect to server through OS explorer. I connect to server via sftp with root user. Then, when I create a folder or php file its ownership belongs to root. I just asked if it is necessary to create each and every file and folder by nginx or site user? or it is OK to be owneby etrader - Nginx Mailing List - English
Thanks folks. Let me conclude that it is better to keep the owner of my folders to be "root". Then give permission to www-data (nginx user) for every writable folder like upload and images? right? My main question is about the folder ownership; which is better? root or www-data? Because when I normally create folder by SSH or SSH tunnel to server, I am there as root and create foldeby etrader - Nginx Mailing List - English
I stored my hosts in /home. To have full functionality of my scripts I gave a write permission to www-data (my nginx user) through SSH with chown command. Although www-data has full permission to /home but I have problem for writing in sub-folders. For example I need to give individually a write permission for .home/domain/images. How I can give write permission to www-data fully?by etrader - Nginx Mailing List - English
I use this rewrite rule to create SEO friendly urls rewrite ^/search/(.*).html /search.php?q=$1 last; I have similar rewrites too; I wonder if it is possible to write a general rule to do so for all php files? I mean rewrites filename.php?q=something to /filename/something.html instead of writing a rewrite rule for each php fileby etrader - Nginx Mailing List - English
When I visit a page like domain.com/not-found.html it will redirects to /404.php but when visiting a page like domain.com/second/not-found.html it returns nothing at all (browser not found page)by etrader - Nginx Mailing List - English
There is no real sub-directory, they are virtual folders created by rewrites; e.g. domain.com/search/keyword.html instead of search.php?q=keyword Config is as server { server_name .domain.com; listen 80; root /home/domain.com; error_page 404 = /404.php; index index.html index.php; rewrite ^/search/(.*).html /search.php?q=$1 last; location ~ \.php$ { fastcgi_pass 12by etrader - Nginx Mailing List - English
I set error page as error_page 404 = 404.php; or error_page 404 = /404.php; in both cases, it will load 404.php when visiting a non-existent page in the main directory as domain.com/not-exist.html; but it will not work for domain.com/sub-dir/not-exist.html How I can set Nginx to redirect to 404.php when visiting any missing page?by etrader - Nginx Mailing List - English
I installed Nginx on different servers. They have almost the same php and nginx settings; but memory usage for each php-fpm is significantly different. When checking by top in ssh, VIRT varies from 20k to 60k; RES from 5k to 20k; SHR from 3k to 15k. We can simply adjust the number php-fpm processes in config, but how we can control the memory usage by each php-fpm process?by etrader - Php-fpm Mailing List - English
They are two separate servers with fresh installation. I mean what can be the cause of this double memory usage in the nginx setting. For some reason, php-fpm is consuming double memory; or maybe fastcgi interface is doing this. I'm just curious to know what setting can be the cause.by etrader - Nginx Mailing List - English
I installed nginx (0.8.7) by rpm on Centos with php-fpm. The total memory used was about 45K I installed nginx (1.0.4) from source on the same conditions, but the total memory used is about 90K as I compared the memory usage by top, I can see the amount used by each php-fpm process is double in the latter case. Any idea? Do I need to adjust setting?by etrader - Nginx Mailing List - English
I removed Apache by "yum remove httpd" before installing Nginx. But php-fpm processes are associated with Apache (instead of Nginx) as (as seen by top command) 1590 root 21 0 13624 2096 340 S 0.0 0.4 0:00.00 nginx 1592 nginx 15 0 13840 2984 992 S 0.0 0.6 0:00.40 nginx 3591 apache 16 0 21348 6172 3600 S 0.0 1.2 0:36.20 php-fpm 7200 apache 15by etrader - Nginx Mailing List - English
I setup error and access logs as access_log /logs/access/$server_name.access.log main; error_log /logs/error/$server_name.error.log info; access logs are created correctly for each virtual host, but for error_log "$server_name" is not transformed to the server name, and one error log named "$server_name.error.log" is created.by etrader - Nginx Mailing List - English
In apache, I used to handle 404.php by $url = getenv("REQUEST_URI"); to get the requested page. Thus, if someone redirected to 404.php from /test.html, I had a php string containing "test.hetml". This is indeed due to the mechanism of redirecting by "ErrorDocument 404 /404.php" in .htaccess In Nginx, I think the mechanism for "error_page 404 /404.php;" isby etrader - Nginx Mailing List - English
Thanks for your informative description. The code is inside 404.php as I want to get the requested page which led to error page. For example, when accessing test.html which does not exist, I want to echo "test.html" by php code of 404.phpby etrader - Nginx Mailing List - English
In my nginx server, $_SERVER['REQUEST_URI']; does not work, and returns nothing. When using getenv("REQUEST_URI"); it will returns the url of the current page instead of the reffering url. And in this case, it will return the current filename (e.g. /test.php) not the full url. I have tested this on apache, and there is no problem; thus it is something related to nginx setting. Any idea?by etrader - Nginx Mailing List - English