Giter VIP home page Giter VIP logo

flutter web at nginx ubuntu server on root domain but returning If you are serving your web app in a path other than the root, change the href value below to reflect the base path you are serving from. about flutter HOT 2 CLOSED

ThwinHAung avatar ThwinHAung commented on June 30, 2024
flutter web at nginx ubuntu server on root domain but returning If you are serving your web app in a path other than the root, change the href value below to reflect the base path you are serving from.

from flutter.

Comments (2)

ThwinHAung avatar ThwinHAung commented on June 30, 2024

this is the configuration
`server {
listen 80;
listen [::]:80;
server_name championmaung.com www.championmaung.com;

# Redirect all HTTP requests to HTTPS
return 301 https://$host$request_uri;

}

server {
listen 443 ssl;
listen [::]:443 ssl;
server_name championmaung.com www.championmaung.com;

ssl_certificate /etc/letsencrypt/live/championmaung.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/championmaung.com/privkey.pem; # managed by Certbot
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_prefer_server_ciphers on;

root /var/www/html/web;
index index.html;

# Serve Flutter web application
location / {
    try_files $uri $uri/ /index.html;
    error_page 405 =200 $uri;
}

# Handle API requests
location ^~ /api {
    alias /var/www/html/laravel_for_football/public;
    try_files $uri $uri/ @laravelapi;

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $request_filename;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}

location @laravelapi {
    rewrite /api/(.*)$ /index.php?$1 last;
}   

# Deny access to hidden files
location ~ /\. {
    deny all;
}

# Custom error page for 404
error_page 404 = /index.html;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }

}

`

from flutter.

darshankawar avatar darshankawar commented on June 30, 2024

@ThwinHAung
I am not sure why are you filing similar issues again, as we had mentioned in previous ones to raise this in StackOverflow.
Please check below issues to see if they help in your case or not:

#68686
#143054
https://stackoverflow.com/questions/67918435/flutter-web-app-in-a-subfolder-just-returns-to-the-root-page

Closing from here.

from flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.