Comments (8)
hmm,
atm i already have a X-Forwarded-Proto header set in my config.
http-request add-header X-Forwarded-Proto https
I've set now the base url to https://grocy.mydomain.tld and it works now on my haproxy. As i do not have the need to use it with https from local-subnet. So i'm happy.
Maybe i'll update my local DNS to have a split-DNS for grocy.mydomain.tld point to my local haproxy ip from local.
If you could add option nr. 2 easily, that would be nice of course. Probably also for future users useful. Depends on your time and the amount of work for you.
Thanks
from grocy.
The URLs are created here - also see the BASE_URL
setting in config.php
. And yes, it's currently not possible to have it to run on both protocols at the same time.
Some thoughts on this:
- As suggested in the referenced ampache issue, you could just rewrite alle the URLs in the HTTP response (don't know if HAProxy can do this)
- You could add a header X-Forwarded-Proto in HAProxy for example (which is pretty standard I think) and I could extend the URL manager to respect this
- I personally run grocy and many other apps in the same way and use "Split-horizon DNS" for everything, so internal traffic stays internal but I can always use the same host name to access the application
Let me know if I should add the second suggested point.
from grocy.
But when you set BASE_URL
to https://grocy.mydomain.tld and when you access grocy from http://192.168.1.105 all URLs will point to https://grocy.mydomain.tld, or not?
I will rethink this, theoretically also relative URLs should work, I don't remember exactly, but there was a problem with something, that's why I added to always use absolute URLs for everything...
from grocy.
But when you set BASE_URL to https://grocy.mydomain.tld and when you access grocy from http://192.168.1.105 all URLs will point to https://grocy.mydomain.tld, or not? <= Yes, i'll have to use https://grocy.mydomain.tld but thats not a problem. as there is no load or bandwidth problem caused by grocy.
I'll check 27daf38
thx
from grocy.
That's right, but when you leave BASE_URL
set to default /
, then the current hostname is used - now while respecting the X-Forwarded-Proto
header - have tested this myself (for this time :D), works as long as you don't have grocy's base in a subdirectory...
from grocy.
A quick note that I don't know if already exists or belongs somewhere else, but for those using Apache as the reverse proxy instead of Nginx, you should do three things:
sudo a2enmod headers
- Add
RequestHeader set X-Forwarded-Proto https
to your .conf sudo systemctl reload apache2
from grocy.
I use HAProxy on pfSense and face the same issue using nginx. Setting BASE_URL
to https://grocy.example.org/
did the trick for me. If the links would really just start with /
the browser should point to the right path, since window.location.href
starts with https
as well. I guess those links are build as absolute links or am I missing something? This error doesn't need to occur, if this was addressed, but not big of a deal.
from grocy.
Setting
BASE_URL
tohttps://grocy.example.org/
did the trick for me.
Leaving BASE_URL
at its default /
just means "auto guess the root", which works for almost all cases pretty well. For any other kind of special setup I don't think it's a real problem to just set it to the proper root URL, which is what you did.
from grocy.
Related Issues (20)
- Feature Request: Using Grocy for more than food - Consumable hardware, electronics and tools for projects? HOT 1
- Feature Request: QR Codes and Product Page for individual items HOT 1
- mysql-Database HOT 5
- Feature Request: less mandatory fields for products HOT 1
- Feature Request: API integration for store products etc HOT 1
- Bug: A server error occured while processing your request HOT 1
- Feature Request: Allow "decimal places" settings > 18 HOT 1
- Feature Request: Generate images of generic products via AI, or search them online HOT 1
- Typo: "product specifc QU conversions" HOT 1
- Feature Request / Idea: a tap-to-add dashboard for quickly updating a shopping list HOT 1
- Bug: FontAwesome icons showing rectangle box with X HOT 3
- Feature Request: Assign multiple categories to one task HOT 2
- Bug: Unable to save chores when chores_assignment: false HOT 1
- Bug: Barcode Not Functioning HOT 1
- Feature Request: Ability to schedule chores with cron expression HOT 2
- Feature Request: User groups for chores HOT 3
- Feature Request: Edit dates that get used in calculations HOT 4
- Bug: Shelf Life is calculated incorrectly if items are already purchased expired HOT 2
- Bug: Product editing form quantity units HOT 2
- Feature Request: Support filenames with none English chars HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grocy.