Loading [MathJax]/jax/output/CommonHTML/config.js
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >403 Forbidden报错拒绝授权访问?

403 Forbidden报错拒绝授权访问?

提问于 2020-09-11 02:26:33
回答 1关注 0查看 580

服务器搭建typecho,安装了nginx、php、mysql,都是默认安装。

修改了下nginx.conf,如下:

user root;

worker_processes auto;

pid /run/nginx.pid;

include /etc/nginx/modules-enabled/*.conf;

events {

worker_connections 768;

# multi_accept on;

}

http {

##

# Basic Settings

##

sendfile on;

tcp_nopush on;

tcp_nodelay on;

keepalive_timeout 65;

types_hash_max_size 2048;

# server_tokens off;

# server_names_hash_bucket_size 64;

# server_name_in_redirect off;

include /etc/nginx/mime.types;

default_type application/octet-stream;

##

# SSL Settings

##

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE

ssl_prefer_server_ciphers on;

##

# Logging Settings

##

access_log /var/log/nginx/access.log;

error_log /var/log/nginx/error.log;

##

# Gzip Settings

##

gzip on;

# gzip_vary on;

# gzip_proxied any;

# gzip_comp_level 6;

# gzip_buffers 16 8k;

# gzip_http_version 1.1;

# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

##

# Virtual Host Configs

##

include /etc/nginx/conf.d/*.conf;

include /etc/nginx/sites-enabled/*;

# Begin HTTP Serve

server {

listen 80; # IPv4

server_name liandy.com;

## Root and index files.

root /var/www/html;

index index.php index.html index.htm;

# autoindex on;

if (-f $request_filename/index.html){

rewrite (.*) $1/index.html break;

}

if (-f $request_filename/index.php){

rewrite (.*) $1/index.php;

}

if (!-e $request_filename){

rewrite (.*) /index.php;

}

## If no favicon exists return a 204 (no content error).

location = /favicon.ico {

try_files $uri =204;

log_not_found off;

access_log off;

}

## Don't log robots.txt requests.

location = /robots.txt {

allow all;

log_not_found off;

access_log off;

}

## Try the requested URI as files before handling it to PHP.

location / {

## Regular PHP processing.

location ~ \.php$ {

try_files $uri =404;

fastcgi_pass unix:/run/php/php7.2-fpm.sock;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

## Static files

location ~* \.(?:css|gif|htc|ico|js|jpe?g|png|swf)$ {

expires max;

log_not_found off;

## No need to bleed constant updates. Send the all shebang in one

## fell swoop.

tcp_nodelay off;

## Set the OS file cache.

open_file_cache max=1000 inactive=120s;

open_file_cache_valid 45s;

open_file_cache_min_uses 2;

open_file_cache_errors off;

}

## Keep a tab on the 'big' static files.

location ~* ^.+\.(?:ogg|pdf|pptx?)$ {

expires 30d;

## No need to bleed constant updates. Send the all shebang in one

## fell swoop.

tcp_nodelay off;

}

} # / location

}

}

按照https://cloud.tencent.com/developer/article/1524178

还是提示403 Forbidden

请问,怎么解决?

网站地址: http://58.87.123.119/

回答 1

EatRice

发布于 2020-09-12 00:15:55

你好,我这边测试你的网页能够正常显示,请检查下你的问题是否存在?

或者在server模块下,server_name liandy.com;

改成:server_name liandy.com localhost;

这样就能开启ip访问

和开发者交流更多问题细节吧,去 写回答
相关文章
Gitlab 403 forbidden
搭建的Gitlab。但今天打开页面的时候显示的是空白页面,上面还有一次文本Forbidden。
匿名用户的日记
2021/12/14
1.4K0
Gitlab 403 forbidden
SpringSecurity 403 forbidden
springboot项目,涉及跨域,跨域问题解决后,整合权限SpringSecurity。 遇到问题:get请求可以正常通过;post请求的OPTIONS请求可以通过,但是post请求403 forbidden 报错。
IT云清
2021/12/10
1.7K0
nginx 403 forbidden
nginx django .conf 配置 nginx python Django 集成总结之-nginx配置
onety码生
2018/11/21
3.2K0
访问网时出现403 Forbidden错误的原因:
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/113700.html原文链接:https://javaforall.cn
全栈程序员站长
2022/07/07
11K1
Nginx出现403 forbidden
于是查看nginx日志,路径为/var/log/nginx/error.log。打开日志发现报错Permission denied,详细报错如下:
全栈程序员站长
2022/06/30
2.5K0
Nginx出现403 forbidden
解决Nginx出现403 forbidden
我是在在本地用虚拟机中通过yum安装nginx的,安装一切正常,但是访问时报403,
用户8832503
2022/03/02
11.3K1
nginx报403 forbidden错误
403 forbidden错误大家应该都熟悉,文件禁止访问,可能是权限问题,也可能是系统问题
opencode
2022/12/26
2.7K0
nginx静态资源文件无法访问,403 forbidden错误
问题 浏览器访问nginx,然后nginx访问静态文件,结果提示403 原因 在nginx.conf的配置中,第一行 user nobody; 但是静态文件都是root的 解决 修改nginx.con
hugo_lei
2021/08/16
9.2K1
nginx静态资源文件无法访问,403 forbidden错误
nginx静态资源文件无法访问,403 forbidden错误
在安装 nginx 服务器后,我想把网站的根目录设置为 /root/www/ ,于是对 nginx 的 nginx.conf 文件进行配置 先打开 nginx.conf #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; event
hbbliyong
2018/03/29
4.7K0
nginx静态资源文件无法访问,403 forbidden错误
apache 允许 访问软链接 ( Apache won't follow symlinks (403 Forbidden) )
当我们在 apache 中 进行访问 www 文件夹之外的目录的时候,我们可以使用软链接的方式来进行协助访问。
西湖醋鱼
2020/12/30
1.7K0
apache 允许 访问软链接 ( Apache won't follow symlinks (403 Forbidden) )
四种解决Nginx出现403 forbidden 报错的方法(转)
我是在在本地用虚拟机中通过yum安装nginx的,安装一切正常,但是访问时报403,
双面人
2019/10/21
3.7K0
img 标签 访问图片 返回403 forbidden问题,meta标签的说明[通俗易懂]
html访问图片资源403问题(http referrer) 前言 之前碰到一个问题,就是html中通过img标签引入一个图片地址,报403。但是这个图片地址直接复制出来在地址栏打开,却是看得到的。
全栈程序员站长
2022/07/11
3K0
img 标签 访问图片 返回403 forbidden问题,meta标签的说明[通俗易懂]
wget下载出现错误 403:Forbidden
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/119548.html原文链接:https://javaforall.cn
全栈程序员站长
2022/07/11
4.6K0
Nginx 出现 403 Forbidden 最终解决方法
1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态
全栈程序员站长
2022/07/11
2.3K0
python抓取不得姐动图(报错 urllib.error.HTTPError: HTTP Error 403: Forbidden)
抓取不得姐动图(报错) # -*- coding:utf-8 -*- #__author__ :kusy #__content__:文件说明 #__date__:2018/7/23 17:01 import urllib.request import re def getHtml(url): page = urllib.request.urlopen(url) html = page.read() # print(html) return html def getImg(
未来sky
2018/08/30
1.4K0
python抓取不得姐动图(报错 urllib.error.HTTPError: HTTP Error 403: Forbidden)
解决Nginx出现403 forbidden (13: Permission denied)报错的四种方法
我是在在本地用虚拟机中通过yum安装nginx的,安装一切正常,但是访问时报403,
用户1214487
2018/12/19
6.5K0
github 提交报403 forbidden的错误解决
创建本地仓库与github的传输 这里假设你的仓库地址为/user/test.git,email地址为youremail@example.com,使用的时候替换成你自己的地址即可。首先注册github帐号,由于你的本地Git仓库和github仓库之间的传输是通过SSH加密的,所以需要使用ssh key: 1)创建SSH Key。在用户主目录下,看看有没有.ssh目录,如果有,再看看这个目录下有没有id_rsa和id_rsa.pub这两个文件,如果有的话,直接跳过此如下命令,如果没有的话,打开命令行,输入如下
三丰SanFeng
2018/01/16
3.4K0
github 提交报403 forbidden的错误解决
gitlab访问限制问题------Forbidden
重启-gitlab:       gitlab-ctl restart          
Wyc
2018/09/11
2.6K0
关于开了CDN网站永久在线后导致typecho密码文章403 Forbidden报错的解决
关于开了博客CDN带的 网站永久在线 导致typecho 密码文章403 Forbidden 报错的解决 今天博主在浏览自己之前水的博文的时候,突然惊现一篇带密码的文章突然打不开了,而且还是403 Forbidden,以为是更新了模板的问题,然后找了模板的作者 Joe老板 探讨了一下,并不是模板的问题! 在没找到原因的情况下,突然想起在2020年元旦的前两天(2020.12.30)把服务器环境从 Apache 更换成了 Nginx 然后就以为是服务器问题,但是经过 Joe老板 的提示下,才发现是CD
骤雨重山
2022/01/17
8130
关于开了CDN网站永久在线后导致typecho密码文章403 Forbidden报错的解决
python测试开发django-66.图片403forbidden
用 django 开发 web 页面,在 HTML 页面上添加图片时,发现本地图片可以正常显示,但是添加一个互联网的图片,却不能正常显示。
上海-悠悠
2019/11/14
6490

相似问题

显示403   forbidden?

21.1K

403Forbidden 权限?

4641

使用公网ip访问服务器,报403 access forbidden?

43.5K

重启CentOS后 网站显示403 forbidden?

21.1K

403 - Forbidden: Access is denied. 权限问题。?

23.6K
相关问答用户
到家集团 | 技术VP擅长5个领域
新浪微博 | 高级总监擅长4个领域
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档