Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2009

    A few nginx questions

    First,for some reason virtual host which i create,i always get error
    403.I tried many things,from chowing to various owners and other,until i
    found temporal solution-i created copy of html directory(which is
    created during install and which working fine) called bla,and pointed
    domain to bla directory and then it worked.But this is problematic since
    all files are in home directory,which means i will need to copy all of
    them into /usr/local/nginx/.
    Also what is problem is with alias,i have a script which is located at
    /home/ also and that again causing that 403 error since it's not located
    in /usr/local/nginx.I tried to make it work by creating symbolic link
    but that didn't worked.Seems only solution would be to copy script to
    nginx directory which will require a lot of file editing because of
    location change.

    Also there is a problem with domain alias-* not working at
    all,nor i have * instead,then i
    get 404 error on directory alias,while it works on www.

    How do i enable hotlink blank protection for images,where images can be
    loaded only by specified domains and direct access?

    And how to rewrite following apache rule:
    RewriteEngine on
    RewriteRule ^directory/(.*)$ /st/st.php?%{QUERY_STRING}
    I using latest stable version,and i think same problems was on latest
    legacy version too.

    Here is my server section of domain:
    server {
    listen 81;
    server_name * ;

    #charset koi8-r;

    #access_log logs/host.access.log main;

    location / {
    root bla;
    index index.php index.html index.htm;
    location /TC/ {
    alias /home/tradecontrol/client/;

    #error_page 404 /404.html;

    # redirect server error pages to the static page /50x.html
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    root bla;

    # proxy the PHP scripts to Apache listening on
    #location ~ \.php$ {
    # proxy_pass;

    # pass the PHP scripts to FastCGI server listening on
    location ~ \.php$ {
    root bla;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME
    include fastcgi_params;

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #location ~ /\.ht {
    # deny all;

  2. #2

    here is now my vhost section looks like.

    server {
        listen   80;
        rewrite ^/(.*)$1 permanent;
    server {
        listen   80;
        charset utf-8;
        access_log /var/www/vhosts/;
        error_log  /var/www/vhosts/;
        root   /var/www/vhosts/;
        index  index.php index.html;
        error_page  404 500 502 503 504 /;
        location ~ \.php$ {
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_NAME      $fastcgi_script_name;
            fastcgi_param  REQUEST_URI      $request_uri;
            fastcgi_param  DOCUMENT_URI     $document_uri;
            fastcgi_param  DOCUMENT_ROOT    $document_root;
            fastcgi_param  REMOTE_ADDR      $remote_addr;
            fastcgi_param  REMOTE_PORT      $remote_port;
            fastcgi_param  SERVER_ADDR      $server_addr;
            fastcgi_param  SERVER_PORT      $server_port;
            fastcgi_param  SERVER_NAME      $server_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
            fastcgi_param  SCRIPT_FILENAME  /var/www/vhosts/$fastcgi_script_name;
    Do you have a running ISP Config on your machine ?
    I believe one of its versions (2 or 3) uses port 81.

  3. #3
    Join Date
    Mar 2009
    At the moment nginx is on 81 since apache is on 80 until i make nginx to work with everything what is required.
    And i have webmin control panel.

  4. #4
    Join Date
    Mar 2009
    And nginx version is 7.Same 403 error was happening with previous version too.

  5. #5
    Join Date
    Mar 2009
    Issue with 403 has been resolved.

Similar Threads

  1. Nginx and progress bar need help please
    By bhanuprasad1981 in forum Hosting Security and Technology
    Replies: 2
    Last Post: 06-02-2009, 12:29 AM
  2. nginx optimization?
    By vigge_sWe in forum Hosting Security and Technology
    Replies: 9
    Last Post: 05-24-2009, 02:27 PM
  3. nginx with cPanel?
    By Matt - Kerplunc in forum Web Hosting
    Replies: 8
    Last Post: 04-17-2009, 02:45 PM
  4. nginx and php issues
    By djsmokin in forum Hosting Security and Technology
    Replies: 10
    Last Post: 03-27-2009, 02:16 PM
  5. Anybody using nginx (httpd)?
    By ub3r in forum Hosting Security and Technology
    Replies: 4
    Last Post: 05-11-2007, 03:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts