Subdomain Setup without subdirectory url not working in Plesk + NGINX

Summary
Can’t setup Mattermost on Subdomain folder WITHOUT subdirectory.
I dont want an “ugly” subdirectory url called mattermost, I want the service to run directly from my root directory. Since I’m a noob im probably missing something but there is no more information talking about hosting it on a platform like plesk.

Yes, I know that there is an extension. And yes, I am using it. But the Version is outdated and doesnt include boards, so I manually updated it. Fully functional, but I really want it not to run from the mattermost subdirectory.

e.g.: matter.samplesite.com not matter.samplesite.com/mattermost/

Steps to reproduce
Casually install and manually configure on Ubuntu 20.04 with latest stable Mattermost
Change SiteURL to wanted subdomain

Expected behavior
Site should normally work but it doesnt

Observed behavior
Entered subdomain without the mattermost directory → error 404 page not found
Entered subdomain with the mattermost directory → blank page

Im tired since ive been trying to make it work for days now.
Plesk nginx.conf looks like this: MOST OF IT HAS BEEN AUTO-GENERATED BY PLESK

nginx.conf
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
#Guess wat. I did it anyway
server {
	listen IPADRESS:443 ssl;

	ssl_certificate             /opt/psa/var/certificates/scfO38nID;
	ssl_certificate_key         /opt/psa/var/certificates/scfO38nID;

	server_name www.matter.samplesite.com;

	location / {
		return 301 https://matter.samplesite.com$request_uri;
	}

	# mailconfig
	location ~* ^/autodiscover/autodiscover\.xml$ {
		try_files $uri @mad;
	}
	location ~* ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ {
		try_files $uri @mad;
	}

	location  ~* ^/email\.mobileconfig$ {
		try_files $uri @mad;
	}

	location @mad {
		rewrite ^(.*)$ /mailconfig/ break;

		proxy_pass                          http://127.0.0.1:8880;
		proxy_set_header X-Host             $host;
		proxy_set_header X-Request-URI      $request_uri;
	}
	# mailconfig
}

server {
	listen IPADRESS:443 ssl;

	server_name matter.samplesite.com;
	server_name ipv4.matter.samplesite.com;

	ssl_certificate             /opt/psa/var/certificates/scfO38nID;
	ssl_certificate_key         /opt/psa/var/certificates/scfO38nID;

	# mailconfig
	location ~* ^/autodiscover/autodiscover\.xml$ {
		try_files $uri @mad;
	}
	location ~* ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ {
		try_files $uri @mad;
	}

	location  ~* ^/email\.mobileconfig$ {
		try_files $uri @mad;
	}

	location @mad {
		rewrite ^(.*)$ /mailconfig/ break;

		proxy_pass                          http://127.0.0.1:8880;
		proxy_set_header X-Host             $host;
		proxy_set_header X-Request-URI      $request_uri;
	}
	# mailconfig

	root "/var/www/vhosts/matter.samplesite.com/httpdocs";
	access_log "/var/www/vhosts/system/matter.samplesite.com/logs/proxy_access_ssl_log";
	error_log "/var/www/vhosts/system/matter.samplesite.com/logs/proxy_error_log";

	#extension sslit begin

	#extension sslit end

	#extension mattermost begin
	location ~* ^/mattermost/api/v[0-9]+/ {
		proxy_pass          http://127.0.0.1:18000;

		proxy_set_header    Upgrade $http_upgrade;
		proxy_set_header    Connection "upgrade";
		proxy_set_header    Host $server_name:$server_port;
		proxy_set_header    X-Real-IP $remote_addr;
		proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header    X-Forwarded-Host $server_name;
		proxy_set_header    X-Forwarded-Proto $scheme;

		proxy_read_timeout  1200s;
		client_max_body_size 0;
	}

	location ~* ^/mattermost {
		proxy_pass          http://127.0.0.1:18000;

		proxy_set_header    Connection "";
		proxy_set_header    Host $server_name:$server_port;
		proxy_set_header    X-Real-IP $remote_addr;
		proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header    X-Forwarded-Host $server_name;
		proxy_set_header    X-Forwarded-Proto $scheme;

		proxy_hide_header X-Frame-Options;
		proxy_hide_header Content-Security-Policy;
		add_header X-Frame-Options "allow-from https://webmail.$server_name";
		add_header Content-Security-Policy "frame-ancestors https://webmail.$server_name";

		proxy_read_timeout  1200s;
		proxy_http_version  1.1;
		client_max_body_size 0;
	}
	#extension mattermost end

	location /internal-nginx-static-location/ {
		alias /var/www/vhosts/matter.samplesite.com/httpdocs/;
		internal;
	}

	disable_symlinks if_not_owner "from=/var/www/vhosts/matter.samplesite.com";

	add_header X-Powered-By PleskLin;

}
server {
	listen MYIPADRESS:80;

	server_name www.matter.samplesite.com;

	location / {
		return 301 https://matter.samplesite.com$request_uri;
	}

	# mailconfig
	location ~* ^/autodiscover/autodiscover\.xml$ {
		try_files $uri @mad;
	}
	location ~* ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ {
		try_files $uri @mad;
	}

	location  ~* ^/email\.mobileconfig$ {
		try_files $uri @mad;
	}

	location @mad {
		rewrite ^(.*)$ /mailconfig/ break;

		proxy_pass                          http://127.0.0.1:8880;
		proxy_set_header X-Host             $host;
		proxy_set_header X-Request-URI      $request_uri;
	}
	# mailconfig
}

server {
	listen MYIPADRESS:80;

	server_name matter.samplesite.com;
	server_name ipv4.matter.samplesite.com;

	# mailconfig
	location ~* ^/autodiscover/autodiscover\.xml$ {
		try_files $uri @mad;
	}
	location ~* ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ {
		try_files $uri @mad;
	}

	location  ~* ^/email\.mobileconfig$ {
		try_files $uri @mad;
	}

	location @mad {
		rewrite ^(.*)$ /mailconfig/ break;

		proxy_pass                          http://127.0.0.1:8880;
		proxy_set_header X-Host             $host;
		proxy_set_header X-Request-URI      $request_uri;
	}
	# mailconfig

	location / {
		return 301 https://$host$request_uri;
	}
}

And the config.json looks like the following:

config.json

{
    "ServiceSettings": {
        "SiteURL": "https://matter.samplesite.com",
        "WebsocketURL": "",
        "LicenseFileLocation": "",
        "ListenAddress": "127.0.0.1:18000",
        "ConnectionSecurity": "",
        "TLSCertFile": "",
        "TLSKeyFile": "",
        "TLSMinVer": "1.2",
        "TLSStrictTransport": false,
        "TLSStrictTransportMaxAge": 63072000,
        "TLSOverwriteCiphers": [],
        "UseLetsEncrypt": false,
        "LetsEncryptCertificateCacheFile": "./config/letsencrypt.cache",
        "Forward80To443": false,
        "TrustedProxyIPHeader": [],
        "ReadTimeout": 300,
        "WriteTimeout": 300,
        "IdleTimeout": 60,
        "MaximumLoginAttempts": 10,
        "GoroutineHealthThreshold": -1,
        "GoogleDeveloperKey": "",
        "EnableOAuthServiceProvider": false,
        "EnableIncomingWebhooks": true,
        "EnableOutgoingWebhooks": true,
        "EnableCommands": true,
        "EnableOnlyAdminIntegrations": true,
        "EnablePostUsernameOverride": false,
        "EnablePostIconOverride": false,
        "EnableLinkPreviews": true,
        "EnableTesting": false,
        "EnableDeveloper": false,
        "EnableOpenTracing": false,
        "EnableSecurityFixAlert": true,
        "EnableInsecureOutgoingConnections": false,
        "AllowedUntrustedInternalConnections": "",
        "EnableMultifactorAuthentication": false,
        "EnforceMultifactorAuthentication": false,
        "EnableUserAccessTokens": false,
        "AllowCorsFrom": "*",
        "CorsExposedHeaders": "",
        "CorsAllowCredentials": false,
        "CorsDebug": false,
        "AllowCookiesForSubdomains": false,
        "ExtendSessionLengthWithActivity": true,
        "SessionLengthWebInDays": 30,
        "SessionLengthMobileInDays": 30,
        "SessionLengthSSOInDays": 30,
        "SessionCacheInMinutes": 10,
        "SessionIdleTimeoutInMinutes": 43200,
        "WebsocketSecurePort": 443,
        "WebsocketPort": 80,
        "WebserverMode": "gzip",
        "EnableCustomEmoji": false,
        "EnableEmojiPicker": true,
        "EnableGifPicker": false,
        "GfycatApiKey": "2_KtH_W5",
        "GfycatApiSecret": "3wLVZPiswc3DnaiaFoLkDvB4X0IV6CpMkj4tf2inJRsBY6-FnkT08zGmppWFgeof",
        "RestrictCustomEmojiCreation": "all",
        "RestrictPostDelete": "all",
        "AllowEditPost": "always",
        "PostEditTimeLimit": -1,
        "TimeBetweenUserTypingUpdatesMilliseconds": 5000,
        "EnablePostSearch": true,
        "MinimumHashtagLength": 3,
        "EnableUserTypingMessages": true,
        "EnableChannelViewedMessages": true,
        "EnableUserStatuses": true,
        "ExperimentalEnableAuthenticationTransfer": true,
        "ClusterLogTimeoutMilliseconds": 2000,
        "CloseUnusedDirectMessages": false,
        "EnablePreviewFeatures": false,
        "EnableTutorial": true,
        "ExperimentalEnableDefaultChannelLeaveJoinMessages": true,
        "ExperimentalGroupUnreadChannels": "disabled",
        "ExperimentalChannelOrganization": false,
        "ExperimentalChannelSidebarOrganization": "disabled",
        "ExperimentalDataPrefetch": true,
        "ImageProxyType": "",
        "ImageProxyURL": "",
        "ImageProxyOptions": "",
        "EnableAPITeamDeletion": false,
        "ExperimentalEnableHardenedMode": false,
        "DisableLegacyMFA": true,
        "ExperimentalStrictCSRFEnforcement": false,
        "EnableEmailInvitations": false,
        "DisableBotsWhenOwnerIsDeactivated": true,
        "EnableBotAccountCreation": false,
        "EnableSVGs": false,
        "EnableLatex": false,
        "EnableLocalMode": false,
        "LocalModeSocketLocation": "/var/tmp/mattermost_local.socket"
    },
    "TeamSettings": {
        "SiteName": "Mattermost",
        "MaxUsersPerTeam": 50,
        "EnableTeamCreation": false,
        "EnableUserCreation": false,
        "EnableOpenServer": false,
        "EnableUserDeactivation": false,
        "RestrictCreationToDomains": "",
        "EnableCustomBrand": false,
        "CustomBrandText": "",
        "CustomDescriptionText": "",
        "RestrictDirectMessage": "any",
        "RestrictTeamInvite": "all",
        "RestrictPublicChannelManagement": "all",
        "RestrictPrivateChannelManagement": "all",
        "RestrictPublicChannelCreation": "all",
        "RestrictPrivateChannelCreation": "all",
        "RestrictPublicChannelDeletion": "all",
        "RestrictPrivateChannelDeletion": "all",
        "RestrictPrivateChannelManageMembers": "all",
        "EnableXToLeaveChannelsFromLHS": false,
        "UserStatusAwayTimeout": 300,
        "MaxChannelsPerTeam": 2000,
        "MaxNotificationsPerChannel": 1000000,
        "EnableConfirmNotificationsToChannel": true,
        "TeammateNameDisplay": "username",
        "ExperimentalViewArchivedChannels": false,
        "ExperimentalEnableAutomaticReplies": false,
        "ExperimentalHideTownSquareinLHS": false,
        "ExperimentalTownSquareIsReadOnly": false,
        "LockTeammateNameDisplay": false,
        "ExperimentalPrimaryTeam": "",
        "ExperimentalDefaultChannels": []
    },
    "ClientRequirements": {
        "AndroidLatestVersion": "",
        "AndroidMinVersion": "",
        "DesktopLatestVersion": "",
        "DesktopMinVersion": "",
        "IosLatestVersion": "",
        "IosMinVersion": ""
    },
    "SqlSettings": {
        "DriverName": "mysql",
        "DataSource": "mmost_thiscloudbeaprefix:stoplookingforsomethinglol@tcp(127.0.0.1:3306)/mattermost_yeye?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s",
        "DataSourceReplicas": [],
        "DataSourceSearchReplicas": [],
        "MaxIdleConns": 20,
        "ConnMaxLifetimeMilliseconds": 3600000,
        "MaxOpenConns": 300,
        "Trace": false,
        "AtRestEncryptKey": "asd",
        "QueryTimeout": 30,
        "DisableDatabaseSearch": false
    },
    "LogSettings": {
        "EnableConsole": true,
        "ConsoleLevel": "INFO",
        "ConsoleJson": true,
        "EnableFile": true,
        "FileLevel": "INFO",
        "FileJson": true,
        "FileLocation": "",
        "EnableWebhookDebugging": true,
        "EnableDiagnostics": true,
        "EnableSentry": true,
        "AdvancedLoggingConfig": ""
    },
    "ExperimentalAuditSettings": {
        "SysLogEnabled": false,
        "SysLogIP": "localhost",
        "SysLogPort": 6514,
        "SysLogTag": "",
        "SysLogCert": "",
        "SysLogInsecure": false,
        "SysLogMaxQueueSize": 1000,
        "FileEnabled": false,
        "FileName": "",
        "FileMaxSizeMB": 100,
        "FileMaxAgeDays": 0,
        "FileMaxBackups": 0,
        "FileCompress": false,
        "FileMaxQueueSize": 1000
    },
    "NotificationLogSettings": {
        "EnableConsole": true,
        "ConsoleLevel": "INFO",
        "ConsoleJson": true,
        "EnableFile": true,
        "FileLevel": "INFO",
        "FileJson": true,
        "FileLocation": ""
    },
    "PasswordSettings": {
        "MinimumLength": 5,
        "Lowercase": false,
        "Number": false,
        "Uppercase": false,
        "Symbol": false
    },
    "FileSettings": {
        "EnableFileAttachments": true,
        "EnableMobileUpload": true,
        "EnableMobileDownload": true,
        "MaxFileSize": 52428800,
        "DriverName": "local",
        "Directory": "./data/",
        "EnablePublicLink": false,
        "PublicLinkSalt": "asdfasdfasdf",
        "InitialFont": "nunito-bold.ttf",
        "AmazonS3AccessKeyId": "",
        "AmazonS3SecretAccessKey": "",
        "AmazonS3Bucket": "",
        "AmazonS3PathPrefix": "",
        "AmazonS3Region": "",
        "AmazonS3Endpoint": "s3.amazonaws.com",
        "AmazonS3SSL": true,
        "AmazonS3SignV2": false,
        "AmazonS3SSE": false,
        "AmazonS3Trace": false
    },
    "EmailSettings": {
        "EnableSignUpWithEmail": true,
        "EnableSignInWithEmail": true,
        "EnableSignInWithUsername": true,
        "SendEmailNotifications": true,
        "UseChannelInEmailNotifications": false,
        "RequireEmailVerification": false,
        "FeedbackName": "",
        "FeedbackEmail": "noreply@matter.samplesite.com",
        "ReplyToAddress": "",
        "FeedbackOrganization": "",
        "EnableSMTPAuth": false,
        "SMTPUsername": "",
        "SMTPPassword": "",
        "SMTPServer": "127.0.0.1",
        "SMTPPort": "25",
        "SMTPServerTimeout": 10,
        "ConnectionSecurity": "",
        "SendPushNotifications": true,
        "PushNotificationServer": "https://push-test.mattermost.com",
        "PushNotificationContents": "full",
        "PushNotificationBuffer": 1000,
        "EnableEmailBatching": false,
        "EmailBatchingBufferSize": 256,
        "EmailBatchingInterval": 30,
        "EnablePreviewModeBanner": true,
        "SkipServerCertificateVerification": false,
        "EmailNotificationContentsType": "full",
        "LoginButtonColor": "#0000",
        "LoginButtonBorderColor": "#2389D7",
        "LoginButtonTextColor": "#2389D7"
    },
    "RateLimitSettings": {
        "Enable": false,
        "PerSec": 10,
        "MaxBurst": 100,
        "MemoryStoreSize": 10000,
        "VaryByRemoteAddr": true,
        "VaryByUser": false,
        "VaryByHeader": ""
    },
    "PrivacySettings": {
        "ShowEmailAddress": true,
        "ShowFullName": true
    },
    "SupportSettings": {
        "TermsOfServiceLink": "https://about.mattermost.com/default-terms/",
        "PrivacyPolicyLink": "https://about.mattermost.com/default-privacy-policy/",
        "AboutLink": "https://about.mattermost.com/default-about/",
        "HelpLink": "https://about.mattermost.com/default-help/",
        "ReportAProblemLink": "https://about.mattermost.com/default-report-a-problem/",
        "SupportEmail": "feedback@mattermost.com",
        "CustomTermsOfServiceEnabled": false,
        "CustomTermsOfServiceReAcceptancePeriod": 365,
        "EnableAskCommunityLink": true
    },
    "AnnouncementSettings": {
        "EnableBanner": false,
        "BannerText": "",
        "BannerColor": "#f2a93b",
        "BannerTextColor": "#333333",
        "AllowBannerDismissal": true
    },
    "ThemeSettings": {
        "EnableThemeSelection": true,
        "DefaultTheme": "default",
        "AllowCustomThemes": true,
        "AllowedThemes": []
    },
    "GitLabSettings": {
        "Enable": false,
        "Secret": "",
        "Id": "",
        "Scope": "",
        "AuthEndpoint": "",
        "TokenEndpoint": "",
        "UserApiEndpoint": ""
    },
    "GoogleSettings": {
        "Enable": false,
        "Secret": "",
        "Id": "",
        "Scope": "profile email",
        "AuthEndpoint": "https://accounts.google.com/o/oauth2/v2/auth",
        "TokenEndpoint": "https://www.googleapis.com/oauth2/v4/token",
        "UserApiEndpoint": "https://people.googleapis.com/v1/people/me?personFields=names,emailAddresses,nicknames,metadata"
    },
    "Office365Settings": {
        "Enable": false,
        "Secret": "",
        "Id": "",
        "Scope": "User.Read",
        "AuthEndpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
        "TokenEndpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/token",
        "UserApiEndpoint": "https://graph.microsoft.com/v1.0/me",
        "DirectoryId": ""
    },
    "LdapSettings": {
        "Enable": false,
        "EnableSync": false,
        "LdapServer": "",
        "LdapPort": 389,
        "ConnectionSecurity": "",
        "BaseDN": "",
        "BindUsername": "",
        "BindPassword": "",
        "UserFilter": "",
        "GroupFilter": "",
        "GuestFilter": "",
        "EnableAdminFilter": false,
        "AdminFilter": "",
        "GroupDisplayNameAttribute": "",
        "GroupIdAttribute": "",
        "FirstNameAttribute": "",
        "LastNameAttribute": "",
        "EmailAttribute": "",
        "UsernameAttribute": "",
        "NicknameAttribute": "",
        "IdAttribute": "",
        "PositionAttribute": "",
        "LoginIdAttribute": "",
        "PictureAttribute": "",
        "SyncIntervalMinutes": 60,
        "SkipCertificateVerification": false,
        "QueryTimeout": 60,
        "MaxPageSize": 0,
        "LoginFieldName": "",
        "LoginButtonColor": "#0000",
        "LoginButtonBorderColor": "#2389D7",
        "LoginButtonTextColor": "#2389D7",
        "Trace": false
    },
    "ComplianceSettings": {
        "Enable": false,
        "Directory": "./data/",
        "EnableDaily": false
    },
    "LocalizationSettings": {
        "DefaultServerLocale": "en",
        "DefaultClientLocale": "en",
        "AvailableLocales": ""
    },
    "SamlSettings": {
        "Enable": false,
        "EnableSyncWithLdap": false,
        "EnableSyncWithLdapIncludeAuth": false,
        "Verify": true,
        "Encrypt": true,
        "SignRequest": false,
        "IdpUrl": "",
        "IdpDescriptorUrl": "",
        "IdpMetadataUrl": "",
        "ServiceProviderIdentifier": "",
        "AssertionConsumerServiceURL": "",
        "SignatureAlgorithm": "RSAwithSHA1",
        "CanonicalAlgorithm": "Canonical1.0",
        "ScopingIDPProviderId": "",
        "ScopingIDPName": "",
        "IdpCertificateFile": "",
        "PublicCertificateFile": "",
        "PrivateKeyFile": "",
        "IdAttribute": "",
        "GuestAttribute": "",
        "EnableAdminAttribute": false,
        "AdminAttribute": "",
        "FirstNameAttribute": "",
        "LastNameAttribute": "",
        "EmailAttribute": "",
        "UsernameAttribute": "",
        "NicknameAttribute": "",
        "LocaleAttribute": "",
        "PositionAttribute": "",
        "LoginButtonText": "SAML",
        "LoginButtonColor": "#34a28b",
        "LoginButtonBorderColor": "#2389D7",
        "LoginButtonTextColor": "#ffffff"
    },
    "NativeAppSettings": {
        "AppDownloadLink": "https://mattermost.com/download/#mattermostApps",
        "AndroidAppDownloadLink": "https://about.mattermost.com/mattermost-android-app/",
        "IosAppDownloadLink": "https://about.mattermost.com/mattermost-ios-app/"
    },
    "ClusterSettings": {
        "Enable": false,
        "ClusterName": "",
        "OverrideHostname": "",
        "NetworkInterface": "",
        "BindAddress": "",
        "AdvertiseAddress": "",
        "UseIpAddress": true,
        "UseExperimentalGossip": false,
        "EnableExperimentalGossipEncryption": false,
        "ReadOnlyConfig": true,
        "GossipPort": 8074,
        "StreamingPort": 8075,
        "MaxIdleConns": 100,
        "MaxIdleConnsPerHost": 128,
        "IdleConnTimeoutMilliseconds": 90000
    },
    "MetricsSettings": {
        "Enable": false,
        "BlockProfileRate": 0,
        "ListenAddress": ":8067"
    },
    "ExperimentalSettings": {
        "ClientSideCertEnable": false,
        "ClientSideCertCheck": "secondary",
        "EnableClickToReply": false,
        "LinkMetadataTimeoutMilliseconds": 5000,
        "RestrictSystemAdmin": false,
        "UseNewSAMLLibrary": false
    },
    "AnalyticsSettings": {
        "MaxUsersForStatistics": 2500
    },
    "ElasticsearchSettings": {
        "ConnectionUrl": "http://localhost:9200",
        "Username": "elastic",
        "Password": "changeme",
        "EnableIndexing": false,
        "EnableSearching": false,
        "EnableAutocomplete": false,
        "Sniff": true,
        "PostIndexReplicas": 1,
        "PostIndexShards": 1,
        "ChannelIndexReplicas": 1,
        "ChannelIndexShards": 1,
        "UserIndexReplicas": 1,
        "UserIndexShards": 1,
        "AggregatePostsAfterDays": 365,
        "PostsAggregatorJobStartTime": "03:00",
        "IndexPrefix": "",
        "LiveIndexingBatchSize": 1,
        "BulkIndexingTimeWindowSeconds": 3600,
        "RequestTimeoutSeconds": 30,
        "SkipTLSVerification": false,
        "Trace": ""
    },
    "BleveSettings": {
        "IndexDir": "",
        "EnableIndexing": false,
        "EnableSearching": false,
        "EnableAutocomplete": false,
        "BulkIndexingTimeWindowSeconds": 3600
    },
    "DataRetentionSettings": {
        "EnableMessageDeletion": false,
        "EnableFileDeletion": false,
        "MessageRetentionDays": 365,
        "FileRetentionDays": 365,
        "DeletionJobStartTime": "02:00"
    },
    "MessageExportSettings": {
        "EnableExport": false,
        "ExportFormat": "actiance",
        "DailyRunTime": "01:00",
        "ExportFromTimestamp": 0,
        "BatchSize": 10000,
        "GlobalRelaySettings": {
            "CustomerType": "A9",
            "SmtpUsername": "",
            "SmtpPassword": "",
            "EmailAddress": "",
            "SMTPServerTimeout": 1800
        }
    },
    "JobSettings": {
        "RunJobs": true,
        "RunScheduler": true
    },
    "PluginSettings": {
        "Enable": false,
        "EnableUploads": false,
        "AllowInsecureDownloadUrl": false,
        "EnableHealthCheck": true,
        "Directory": "./plugins",
        "ClientDirectory": "./client/plugins",
        "Plugins": {},
        "PluginStates": {
            "com.mattermost.nps": {
                "Enable": true
            }
        },
        "EnableMarketplace": true,
        "EnableRemoteMarketplace": true,
        "AutomaticPrepackagedPlugins": true,
        "RequirePluginSignature": false,
        "MarketplaceUrl": "https://api.integrations.mattermost.com",
        "SignaturePublicKeyFiles": []
    },
    "DisplaySettings": {
        "CustomUrlSchemes": [],
        "ExperimentalTimezone": false
    },
    "GuestAccountsSettings": {
        "Enable": false,
        "AllowEmailAccounts": true,
        "EnforceMultifactorAuthentication": false,
        "RestrictCreationToDomains": ""
    },
    "ImageProxySettings": {
        "Enable": false,
        "ImageProxyType": "local",
        "RemoteImageProxyURL": "",
        "RemoteImageProxyOptions": ""
    }
}

Okay I’ve actually managed to fix it… i can’t say where the problem was…
The only thing I changed was to change the SiteURL via the System Console :melting_face:

@mv-stns Do you mind sharing your instructions?
I’m trying to install mattermost without a subdirectory, I tried moving all the files to the httpdocs folder and changing the SiteURL in the console but when going to the homepage I just get a 403 error saying that there are no directory index…
did you use the extension in the end?

1 Like

You gotta change your nginx config manually.

FIRST OF ALL!

Change your Site-URL path from the System Console Menu to the Main URL without pathing to the subdirectory. (this worked for me without the following changes).
Don’t move any files! Leave them in the subdirectory!

After you changed everything, you should hot reload with cli command: nginx -s reload

If everything is working, you should be good to go. Otherwise…

If your websocket isnt working, which can be identified in the browser console, please change the websocket nginx.conf settings to the following:

location ~* /api/v[0-9]+/(users/)?websocket$ {
                proxy_pass          http://127.0.0.1:18002;

                proxy_set_header    Upgrade $http_upgrade;
                proxy_set_header    Connection "upgrade";
                proxy_set_header    Host $server_name:$server_port;
                proxy_set_header    X-Real-IP $remote_addr;
                proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header    X-Forwarded-Host $server_name;
                proxy_set_header    X-Forwarded-Proto $scheme;

                proxy_read_timeout  1200s;
                client_max_body_size 0;
        }

Here too, hot reload with cli command: nginx -s reload
If you need further assistance, feel free to reply.

Thanks.
I tried this but now I’m getting a 502 gateway error.
I’m wondering if it has to do with the port.
Where did you find port 18002?
Why am I changing it to that?

Actually, Not sure what I did, But I put it back to port 18000 and reloaded NGINX and now it is working fine.
Thank you for your tips.
Really appreciate it.
You should set your solution to Subdomain Setup without subdirectory url not working in Plesk + NGINX - #4 by mv-stns

1 Like

I’m using that port because my server assigned it to it automatically. I am not certain why, though. Probably because I’m having multiple domains running on my system, and the Mattermost Plesk extension is installing the Service every time I’m adding a domain. So, he has to set a new port.

But it’s wonderful to hear it worked out after resetting your port!

You should also note that any further adjustments to nginx from the Plesk backend, even a certificate update, could break the manual edited config file. You should consider creating a github gist, backing up the config or save it somewhere else to see what changes you’ve made in the future. Of course bookmarking this thread also works :stuck_out_tongue: