diff --git a/modules/shared.py b/modules/shared.py index 09cbedcf..20eaff58 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -195,6 +195,7 @@ group.add_argument('--gradio-auth', type=str, help='Set Gradio authentication pa group.add_argument('--gradio-auth-path', type=str, help='Set the Gradio authentication file path. The file should contain one or more user:password pairs in the same format as above.', default=None) group.add_argument('--ssl-keyfile', type=str, help='The path to the SSL certificate key file.', default=None) group.add_argument('--ssl-certfile', type=str, help='The path to the SSL certificate cert file.', default=None) +group.add_argument('--subpath', type=str, help='Customize the subpath for gradio, use with reverse proxy') # API group = parser.add_argument_group('API') diff --git a/server.py b/server.py index 7afa954e..f057d233 100644 --- a/server.py +++ b/server.py @@ -169,6 +169,7 @@ def create_interface(): ssl_verify=False if (shared.args.ssl_keyfile or shared.args.ssl_certfile) else True, ssl_keyfile=shared.args.ssl_keyfile, ssl_certfile=shared.args.ssl_certfile, + root_path=shared.args.subpath, allowed_paths=["cache", "css", "extensions", "js"] )