Comments (7)
How did you setup expose and your nginx? Also how does your client connect to the server (which port)
from expose.
EDIT: Updated with my full nginx config
Hey Marcel. Thanks for looking at this. The following nginx config runs on *.example.com:
nginx.conf
server {
listen IP_ADDRESS:443 ssl http2;
server_name _.example.com;
server_name ~^.*\.example\.com$;
ssl_certificate /etc/letsencrypt/live/example.com/full.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/full.pem;
client_max_body_size 128m;
root "/var/www/vhosts/example.com";
access_log "/var/log/www/example.com/access_ssl_log";
error_log "/var/log/www/example.com/error_log";
location / {
proxy_pass http://127.0.0.1:3250;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_cache_bypass $http_upgrade;
proxy_read_timeout 60;
proxy_connect_timeout 60;
proxy_redirect off;
}
}
*.example.com also has a proper wildcard letsencrypt certificate set up.
The expose config on the server looks like this:
Server: .expose/config.php
<?php
return [
'host' => 'niess.space',
'port' => 443,
'auth_token' => '',
'default_tld' => 'test',
'max_logged_requests' => 25,
'memory_limit' => '128M',
'skip_body_log' => [
'status' => [
// "4*"
],
'content_type' => [
//
],
'extension' => [
'.js.map',
'.css.map',
],
'size' => '1MB',
],
'admin' => [
'database' => implode(DIRECTORY_SEPARATOR, [
$_SERVER['HOME'] ?? __DIR__,
'.expose',
'expose.db',
]),
'validate_auth_tokens' => true,
'maximum_connection_length' => 0,
'subdomain' => 'expose',
'subdomain_generator' => \App\Server\SubdomainGenerator\RandomSubdomainGenerator::class,
'users' => [
'admin' => 'password',
],
'user_repository' => \App\Server\UserRepository\DatabaseUserRepository::class,
'messages' => [
'message_of_the_day' => 'Thank you for using expose.',
'invalid_auth_token' => 'Authentication failed. Please check your authentication token and try again.',
'subdomain_taken' => 'The chosen subdomain :subdomain is already taken. Please choose a different subdomain.',
],
],
];
I run the server with expose serve example.com --port 3250
The client config looks like this:
Server: .expose/config.php
<?php
return [
'host' => 'a.example.com',
'port' => 443,
'auth_token' => 'myauthtoken',
'default_tld' => 'test',
'max_logged_requests' => 25,
'memory_limit' => '128M',
'skip_body_log' => [
'status' => [
// "4*"
],
'content_type' => [
//
],
'extension' => [
'.js.map',
'.css.map',
],
'size' => '1MB',
],
'admin' => [
'database' => implode(DIRECTORY_SEPARATOR, [
$_SERVER['HOME'] ?? __DIR__,
'.expose',
'expose.db',
]),
'validate_auth_tokens' => false,
'maximum_connection_length' => 0,
'subdomain' => 'expose',
'subdomain_generator' => \App\Server\SubdomainGenerator\RandomSubdomainGenerator::class,
'users' => [
'username' => 'password',
],
'user_repository' => \App\Server\UserRepository\DatabaseUserRepository::class,
'messages' => [
'message_of_the_day' => 'Thank you for using expose.',
'invalid_auth_token' => 'Authentication failed. Please check your authentication token and try again.',
'subdomain_taken' => 'The chosen subdomain :subdomain is already taken. Please choose a different subdomain.',
],
],
];
Notice, that I use port 443 to connect to a.example.com because example.com is already in use on the server hosting a website. Kind of a hack, but it works. I can successfully expose my sites and see the result at https://{subdomain}.example.com (manually removing the "a"). I can also open https://expose.example.com to generate my login token. Shared sites are shown in the backend as http://{subdomain}.example.com:3250 (I think they should be shown as https://{subdomain}.example.com, though).
The only problem is that all links generated by the route helper point to http://{subdomain}.example.com:3250.
from expose.
hm that all looks good. And is pretty much my setup too. Could you show me the headers that you see in your dashboard when sharing a local url?
from expose.
Here you go:
redacted
from expose.
I noticed that the nginx config is indeed different than mine:
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
Could you try adding those headers?
from expose.
Perfect, that works. I'll PR the docs.
from expose.
Awesome, thanks!
from expose.
Related Issues (20)
- Set TCP Port range in Docker
- Client > Configuration page does not work
- Could not connect to the server. Connection to tls://us-1.sharedwithexpose.com:443 failed during TLS handshake: SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:ssl3_get_record:wrong version number HOT 7
- Asset URLs Contain Incorrect Port in Laravel Sail Environment with Expose Reverse Proxy HOT 1
- Docker
- Could not connect to server error:80000002 HOT 5
- Could not connect to the server. - 502 Bad Gateway HOT 2
- Carbon\Carbon::setLastErrors(): Argument #1 ($lastErrors) must be of type array, bool given HOT 1
- Docs don't reflect renaming 'auth' argument to 'basicAuth'
- Auto restarting after disconnect HOT 1
- Authentication failed HOT 6
- Authentication Error on Pro License HOT 6
- Could not connect to the server.
- OpenSSL certificate verify failed HOT 4
- [Bug]: expose command not found HOT 1
- OpenSSL Error: wrong version number HOT 13
- [Bug]: Website documentation images broken
- [Bug]: Config Page missing -- How to configure client for docker server?
- [Bug]: Standard Laravel install with Vite - CSS not loading HOT 4
- [Feature Request]: Request Store Limit
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 expose.