TXT File in Root htdocs Folder (EE v4)

I uploaded a TXT file in the root directory of the folder path:


However, I keep getting a 403 Forbidden error with “openresty” at the bottom.

How can I access this file correctly?

You did not indicate the URL to access the txt file. But I am going to make a few assumptions and try to offer some places to look for answers.

To start, the 403 forbidden indicates that most likely your conf settings are not allowing txt files to be read or executed. You can check /opt/easyengine/sites/youriste.com/config/nginx/conf.d/main.conf and look for location blocks that forbid txt or similar. I see this in my site’s standard EE default config

# Return 403 forbidden for readme.(txt|html) or license.(txt|html) or example.(txt|html) if ($uri ~* "^.+(readme|license|example)\.(txt|html)$") { return 403; }

I also see location deny blocks for hidden files and a selection of common backup and log file extensions.

The next items I would check are the file owner:group and permissions. The owners should be www-data:www-data and not root or other users. And the permissions should most likely be 644 or if the group needs write permissions then 664. There is no reason for a text file to ever have execute permissions so make sure that you do not see a 7 in any of the file permissions.

My guess is that it is either owner or file permissions unless you just happened to choose readme.txt, license.txt or example.txt as your text file name.

I did the latter at the very beginning so I know that’s not the issue because even with that ownership change, it still threw the 403.

I’ll have to try the first suggestion! Thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.