我使用nginx作为本地主机,并使用gatsby创建登录页面,我按照所有步骤使用gatsby主题页面,该页面按预期工作,但是当我尝试重新加载页面或返回页面时它显示:
403禁止进入
nginx / 1.14.0(Ubuntu)
我已经注意到,即使位于另一个文件夹中,我的index.html也将始终具有组件--- ***。js文件所在位置的url。
我的nginx.conf文件:
server {
listen 80;
listen [::]:80;
access_log /tmp/kikbix.access.log;
error_log /tmp/kikbix.error.log;
# set client body size to 2M #
client_max_body_size 5M;
root /home/leandro/projects/kikbix/kikbix/www;
index index.php;
server_name kikbix.local;
location / {
rewrite \.(?:jpe?g|gif|png)$ /system/library/adaptive-images.php;
try_files $uri $uri/ /index.php?_route_=$uri&$args;
}
location image/cache {}
location image/cielo {}
location image/flags {}
location image/maintenance_gallery {}
location image/templates {}
location image/ai-cache {}
location ~ \.php$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
}
lea
我的gatsby.conf文件:
require(`dotenv`).config({
path: `.env`,
})
module.exports = {
pathPrefix: `/catalog/view/theme/tristris/template/index/public`,
siteMetadata: {
// You can overwrite values here that are used for the SEO component
// Of course you can also add new values here to query them like usual
// See all options: https://github.com/LekoArts/gatsby-themes/blob/master/themes/gatsby-theme-cara/gatsby-config.js
siteTitle: `index`,
siteTitleAlt: `Cara - Gatsby Starter Portfolio`,
siteUrl: `http://kikbix.local/index.php?route=common/index`,
},
plugins: [
{
resolve: `@lekoarts/gatsby-theme-cara`,
// See the theme's README for all available options
options: {},
},
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: process.env.GOOGLE_ANALYTICS_ID,
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `Cara - @lekoarts/gatsby-theme-cara`,
short_name: `Cara`,
description: `Playful and Colorful One-Page portfolio featuring Parallax effects and animations`,
start_url: ``,
background_color: `#141821`,
theme_color: `#f6ad55`,
display: `standalone`,
icons: [
{
src: `/android-chrome-192x192.png`,
sizes: `192x192`,
type: `image/png`,
},
{
src: `/android-chrome-512x512.png`,
sizes: `512x512`,
type: `image/png`,
},
],
},
},
`gatsby-plugin-offline`,
`gatsby-plugin-netlify`,
],
}