1

I'm trying to route all the URL to trailing slashes in Google App Engine (nginx server)

I have an Angular-Laravel 5.0 app. By default I am routing all the request to index.php which is located in public/app/ dir so for that I have below rules

This is how my nginx-app.conf looks like

location / {
  index index.php index.html index.html index.js, index.shtml;
  try_files $uri $uri/ /index.php?$query_string;
}

This is how my app.yaml looks like

runtime: php
env: flex

runtime_config:
  document_root: public

This is what I have in app/Http/routes.php

Route::get('/', function () {
    return redirect('/app/');
});

My issue is

When I am visiting my site through URL https://project-id.appspot.com/app/ it is redirecting me to https://project-id.appspot.com/app/#/access/signin but if I tried with

  • https://project-id.appspot.com/
  • https://project-id.appspot.com
  • https://project-id.appspot.com/app

it is redirecting me to http://project-id.appspot.com:8080/app/ not to https://project-id.appspot.com/app/

I have google regarding this and found out this answer, but I do not know how to use it with my existing rules.

I'll highly appreciate if someone can guide me.

Please Note: I'm pretty new in nginx server

Thanks in advance.

Joan Grau Noël
  • 3,084
  • 12
  • 21
Raunak Gupta
  • 10,412
  • 3
  • 58
  • 97

0 Answers0