简体   繁体   English

将雨果网站部署到谷歌云应用引擎的问题

[英]issues with deploying hugo site to google cloud app engine

So I'm trying to deploy my Hugo blog to google cloud app engine, but I'm having issue with the URL mapping,I have played with it a lot but nothing seem to work所以我正在尝试将我的 Hugo 博客部署到谷歌云应用引擎,但我遇到了 URL 映射问题,我已经玩了很多但似乎没有任何效果

The home page is working and I can see the the posts but when I click on a post I got error: Not Found message主页正在运行,我可以看到帖子,但是当我点击帖子时出现错误:未找到消息

app.yaml应用程序.yaml

env: standard
runtime: nodejs16
service: default
handlers:
  - url: /
    static_files: public/index.html
    upload: public/index.html
  - url: /posts
    static_dir: public/posts
  - url: /(.*)
    static_files: public/\1
    upload: public/(.*)

Files structure文件结构

在此处输入图像描述

website link: https://www.waelfadlallah.com/网址链接: https://www.waelfadlallah.com/


Thank to NoCommandLine the issue is resolved, here is how my app.yaml looks like now感谢NoCommandLine问题已解决,这是我的 app.yaml 现在的样子

env: standard
runtime: nodejs16
service: default
handlers:
  - url: /posts/(.+)/
    static_files: public/posts/\1/index.html
    upload: public/posts/(.+)/index.html
  - url: /assets
    static_dir: public/assets
  - url: /
    static_files: public/index.html
    upload: public/index.html

See if this works....看看这是否有效......

Instead of using static_dir , try using static_files and have your handler like the example here .不要使用static_dir ,而是尝试使用static_files并让您的处理程序像此处的示例一样。 That example has (the sample below).该示例有(下面的示例)。 See if you can modify it to suit your pattern看看你是否可以修改它以适合你的模式

- url: /([^\.]+)([^/])
  static_files: www/\1\2/index.html
  upload: www/(.+)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Cloud App Engine 的 MIME 类型问题 - MIME type issues with Google Cloud App Engine 使用 Google Cloud App Engine 将前端和后端部署为两个独立的应用程序 - Deploying FrontEnd and BackEnd as two separate applications with Google Cloud App Engine 在 Google Cloud App Engine 中部署 Django 应用后网站无法加载 - The website doesn't load after deploying Django app in Google Cloud App Engine 将 .NET 核心应用程序从 Google App Engine 迁移到 Google Cloud Run - SQL 连接问题 - Migrate .NET Core app from Google App Engine to Google Cloud Run - SQL connection issues 将 Laravel 应用程序部署到 Google App Engine - Deploying Laravel app to Google App Engine 无法在谷歌云引擎上下载 apple-app-site-association,但在本地一切正常(角度) - Not able to download apple-app-site-association on google cloud engine, however locally all ok (angular) Quarkus 部署到 Google Cloud App 引擎失败 - Quarkus deployment to Google Cloud App engine fails Google Cloud App Engine 中的 Angular 7 路由不起作用 - Angular 7 Routing in Google Cloud App Engine not working Spring 在 Google Cloud App Engine 上启动托管 - Spring Boot hosting on Google Cloud App Engine Web 站点登录 Java + Google App Engine - Web site login in Java + Google App Engine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM